(1) ADO - GetRows. .
(2) VBScript . , UBounds:
Dim aFix(2, 3)
. ReDim [Preserve]. -
ReDim aDyn(2, 3)
Dim aDyn : aDyn = Array()
. 22: Preserve .
(3)
Dim data2()
- . , "" , , VBScript :
>> Dim data2()
>> WScript.Echo UBound(data2)
>>
Error Number: 9
Error Description: Subscript out of range
Dim a() - , ReDim :
>> Dim data2() ' <-- abomination
>> ReDim data2(1,1) ' <-- overwritten by a dynamic array
>> data2(0,0) = 0
>> ReDim Preserve data2(1,5) ' last dimension increased; 'old' data preserved
>> data2(1,5) = 1
>> WScript.Echo data2(0,0), data2(1,5)
>>
0 1
wrt jmbpiano:
(1) , UBound dimmed with(), , . ( ), , () .
(2) , ReDim a(KnownUbound) "" , "Option Explicit" - . :
Option Explicit
ReDim a(4711)
ReDim b(4,7,1,1)
a(0) = "qed"
b(0,0,0,0) = "qed"
WScript.Echo b(0,0,0,0)
:
cscript 19888987.vbs
qed