Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Documentation Help Nits

samintz

Scott Mintz
May
1,590
27
The examples for @ARRAYINFO are incorrect. This is what it currently says:

@ARRAYINFO will return -1 if the array doesn't exist.

Examples:

setarray array[5,10]
echo %@arrayinfo[0]
2

echo %@arraninfo[2]
10

The echo statements are missing the array name. Plus the typo on the second echo.
 
Hmmm! What version/OS? It seems right here (Win7/32).
Code:
v:\> setarray array[5,10]
 
v:\> echo %@arraninfo[0]
TCC: (Sys) Incorrect function.
"%@arraninfo[0]"
 
v:\> echo %@arrayinfo[0]
-1
 
v:\> ver
 
TCC  14.02.44  Windows 7 [Version 6.1.7601]
 
v:\>
 
Vince,

The correct syntax includes the array name in the function.
Code:
[C:\] setarray array[5,10]
 
[C:\] echo %@arrayinfo[array,0]
2
 
[C:\] echo %@arrayinfo[array,1]
5
 
[C:\] echo %@arrayinfo[array,2]
10
 
[C:\] echo %@arrayinfo[array,5]
50

Your code snippet proves my point. The help file's examples are incorrect.
-Scott
 
OK, I missed your point. I thought you were saying that you were getting results without naming the array. I agree, the examples are flawed.
 

Similar threads

Replies
0
Views
226
Back
Top