Documentation Help Nits

samintz

Scott Mintz
May 20, 2008
1,264
11
Solon, OH, USA
#1
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.
 
#2
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:\>
 

samintz

Scott Mintz
May 20, 2008
1,264
11
Solon, OH, USA
#3
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