1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Documentation Help Nits

Discussion in 'Support' started by samintz, Nov 14, 2012.

  1. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,188
    Likes Received:
    11
    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. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    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:\>
     
  3. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,188
    Likes Received:
    11
    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
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    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.
     

Share This Page