Documentation Help Nits

samintz

Scott Mintz
May 20, 2008
1,557
26
Solon, OH, USA
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.
 
May 20, 2008
12,173
133
Syracuse, NY, USA
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,557
26
Solon, OH, USA
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
 
May 20, 2008
12,173
133
Syracuse, NY, USA
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