STAT1

Summary


stat1 contains the number of lines returned by a system command.

Class, type and dimension

Shortint [S]stat1

Examples

   # Extraction of a process making the list of a directory under Unix.
    Char LIST(80) (100)
    System LIST = "ls -l" - DIR_PATH
    NBL =
stat1
    For I = 1 To min(dim(LISTE), NBL)
       Infbox LIST(I - 1)
    Next I

Description and comments

The stat1 variable is updated :

- by the System instruction used with recovery of the result of the system command in a sized variable. The stat1 variable then contains the number of lines returned by the command. If this number exceeds the number of dimensions for the assigned variable, then this latter data will be lost,

- internal fashion at any time.

It is therefore strongly recommended to store the contents of the stat1 variable, following the launch of the system command, in a variable where the value will be tested.

Remarks

When the system command is executed in interactive mode on a local machine (therefore if it starts with the characters '!!@'), the variable [S]stat1 contains the Unix error number for the system command executed if this has failed.

Associated errors

No associated errors.

Associated keywords

SYSTEM


SUMMARY


Copyright © Sage 1999 - 2007