VBS array of arrays 
Author Message
 VBS array of arrays

Hi,

This is just FYI, the technique I'd like to share. There is a way for VBS to use
'array of arrays', the same way as Java does. Net effect is much the same as
with multidimensional array, but you may change the size of any array
('dimension').

Here is a sample:

Sub RedimArray(byref a, size)
  redim preserve a(size)
End Sub

Dim a()
RedimArray a, 2

a(0) = Array(0, 1, 2)
a(1) = Array(4, 5, 6)
RedimArray a(0), 4
'-- this woudn't work: redim preserve a(0)(4)

a(0)(3) = 3
MsgBox a(0)(3)
MsgBox UBound(a(0))
MsgBox UBound(a(1))

Regards,
Captain Cerebrum
Innovative extensions for IE4 and HTML Help authoring
http://www.*-*-*.com/
FREE ScriptX: Dynamic Event Binding, Printing
http://www.*-*-*.com/



Fri, 09 Mar 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. wsh/ jscript : BUG : array of array, 2D array

2. Server Array to Client-Side Array

3. Compose JavaScript Array by VB array

4. perl hash array/javascript arrays

5. Help converting server-side VBScript array into client-side JScript array

6. Array size of a 2 dimensional array

7. VB array to Java Array

8. Array of arrays with ASP

9. Passing Array to Session Variable Then back to Array

10. Server Array to Client-Side Array

11. array pointing to other arrays

12. Array Filter Function and 2D Array

 

 
Powered by phpBB® Forum Software