Hello,Has anyone tried using arrays yet? I can't get them to work with a global statement.
code:
Global $sserver[3]
It does work with a Dim statement, but I have to make sure to Dim the array at my outermost context if I want to use the array globally.
Another problem I have noticed in the declarations is: The manual states:
code:
Dim $Counters[14]
Dim $Sums[20]
"The first declaration creates an array with 15 elements, with index numbers running from 0 to 14. The second creates an array with 21 elements, with index numbers running from 0 to 20."
When I try the following code:
code:
Dim $Counters[14]
$index=0
while $index<15
$Counters[$index]=$index
? "Counters[$index]="+$Counters[$index]
$index=$index+1
loop
I receive an array reference out of bounds error message when the value of index goes to 14 and the script tries to execute the assignment statement. It seems to me that the code:
code:
Dim $Counters[14]
is really creating a 14 element array with index numbers running from 0 to 13. Has anyone else experienced this or have any other input?Finally on arrays, is there a function to return the maximum index of an array?
Regards,
Brad