![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Array help please I need to know how I can query the size of the second element in 2 two dimentional array. In the example below it would be 3. I tried UBound and LBound but they don't give me the result. Dim myarray ReDim myarray(1,3) myarray(0,0)="A" myarray(0,1)="AA" myarray(0,2)="AAA" myarray(0,3)="AAAA" myarray(1,0)="A" myarray(1,1)="AA" myarray(1,2)="AAA" myarray(1,3)="AAAA" |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Array help please "Bob Smith" <BobSmith@xxxxxx> wrote in message news:E4424F42-C075-44EB-A2A4-322E6366B177@xxxxxx Quote: >I need to know how I can query the size of the second element in 2 two > dimentional array. In the example below it would be 3. I tried UBound and > LBound but they don't give me the result. > > Dim myarray > > ReDim myarray(1,3) > > myarray(0,0)="A" > myarray(0,1)="AA" > myarray(0,2)="AAA" > myarray(0,3)="AAAA" > myarray(1,0)="A" > myarray(1,1)="AA" > myarray(1,2)="AAA" > myarray(1,3)="AAAA" > wscript.echo UBound(myarray,2) (found in the downloadable VB Script help file script56.chm) |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Array help please Bob Smith schrieb: Quote: > I need to know how I can query the size of the second element in 2 two > dimentional array. In the example below it would be 3. I tried UBound and > LBound but they don't give me the result. > > Dim myarray > > ReDim myarray(1,3) > > myarray(0,0)="A" > myarray(0,1)="AA" > myarray(0,2)="AAA" > myarray(0,3)="AAAA" > myarray(1,0)="A" > myarray(1,1)="AA" > myarray(1,2)="AAA" > myarray(1,3)="AAAA" > but if you mean "size of the second dimension": WScript.Echo "UBound( myarray, 1 [= first dimension] )", UBound( myarray, 1 ) WScript.Echo "UBound( myarray, 2 [= second dimension] )", UBound( myarray, 2 ) output: UBound( myarray, 1 [= first dimension] ) 1 UBound( myarray, 2 [= second dimension] ) 3 |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Array help please Thanks for your help! "ekkehard.horner" wrote: Quote: > Bob Smith schrieb: Quote: > > I need to know how I can query the size of the second element in 2 two > > dimentional array. In the example below it would be 3. I tried UBound and > > LBound but they don't give me the result. > > > > Dim myarray > > > > ReDim myarray(1,3) > > > > myarray(0,0)="A" > > myarray(0,1)="AA" > > myarray(0,2)="AAA" > > myarray(0,3)="AAAA" > > myarray(1,0)="A" > > myarray(1,1)="AA" > > myarray(1,2)="AAA" > > myarray(1,3)="AAAA" > > > but if you mean "size of the second dimension": > > WScript.Echo "UBound( myarray, 1 [= first dimension] )", UBound( myarray, 1 ) > WScript.Echo "UBound( myarray, 2 [= second dimension] )", UBound( myarray, 2 ) > > output: > > UBound( myarray, 1 [= first dimension] ) 1 > UBound( myarray, 2 [= second dimension] ) 3 > > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Array help please Thanks for the help! "Pegasus (MVP)" wrote: Quote: > > "Bob Smith" <BobSmith@xxxxxx> wrote in message > news:E4424F42-C075-44EB-A2A4-322E6366B177@xxxxxx Quote: > >I need to know how I can query the size of the second element in 2 two > > dimentional array. In the example below it would be 3. I tried UBound and > > LBound but they don't give me the result. > > > > Dim myarray > > > > ReDim myarray(1,3) > > > > myarray(0,0)="A" > > myarray(0,1)="AA" > > myarray(0,2)="AAA" > > myarray(0,3)="AAAA" > > myarray(1,0)="A" > > myarray(1,1)="AA" > > myarray(1,2)="AAA" > > myarray(1,3)="AAAA" > > > Try this: > wscript.echo UBound(myarray,2) > (found in the downloadable VB Script help file script56.chm) > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Fast copy method of sub array (=array range) possible? | VB Script | |||
| How to create array without quotes? $array = (a,b,c) | PowerShell | |||
| Array indexing: Want to say "Item #2 through the rest of the array." | PowerShell | |||
| Stupid Array Tricks: Initializing an Array to a Certain Size | PowerShell | |||
| how to assign values to array and how to create array via variable | PowerShell | |||