一个 Array 的练习
1 <script language="VBScript"> 2 <!-- 3 Dim score() 4 ReDim score(3) 5 score(0) = 10 6 score(1) = 20 7 score(2) = 30 8 score(3) = 40 9 10 Dim cr : Dim msg 11 cr = Chr(13) & Chr(10) 12 msg = score(0) & cr & score(1) & cr & score(2) & cr & score(3) 13 MsgBox msg 14 15 msg = "" 16 17 ReDim score(4) : score(4) = 50 18 msg = score(0) & cr & score(1) & cr & score(2) & cr & score(3) & cr & score(4) 19 MsgBox msg 20 21 msg = "" 22 23 ReDim preserve score(5) 24 score(0) = 101 25 score(1) = 102 26 score(2) = 103 27 score(3) = 104 28 'score(4) = 105 29 score(5) = 106 30 msg = score(0) & cr & score(1) & cr & score(2) & cr & score(3) & cr & score(4) & cr & score(5) 31 MsgBox msg 32 //--> 33 </script>