Local Variables

Local variables start with a hash sign (#). There are two types of local variables:

Local variables with value type Integer:

#CNT0 - 9 #FILEHOUR #FILETYPE
#COL #FILEMINUTE #FILEYEAR
#ELAPSETIME #FILEMONTH #LENGTH
#FILEDATE #FILESECOND #PARMNO
#FILEDAY #FILESIZE #ROW

Local variables with value type String:

#ENVIRONMENT #FILEMODE #FILETIME
#FILEDRIVE #FILENAME #PARM0
#FILEEXT #FILEPATH #PARM1 - 9
#FILEINFO #FILESPEC #RC

The value of a local variable is reset when the procedure file terminates. Using the SET command, you can define values for local variables. Many Entire Connection commands save their result(s) in local variables.

This document covers the following topics:


Local Variables with Value Type Integer

Variables with value type Integer may contain a positive number between 0 and 32767.

#CNT0 - 9

You can use the variables #CNT1 through #CNT9 as counters.

#COL

This variable is set by the commands IF and WAITFOR. It then contains a number between 1 and the maximum line length. This number indicates the column number of the terminal emulation screen.

#ELAPSETIME

This variable is set by the ELAPSETIME command. It then contains the difference between two date and time stamps.

#FILEDATE

This variable is set by the DOSDIR command. It then contains the date on which a file was created or updated.

#FILEDAY

This variable is set by the DOSDIR command. It then contains the day of the month on which a file was created or updated.

#FILEHOUR

This variable is set by the DOSDIR command. It then contains the hour at which a file was created or updated.

#FILEMINUTE

This variable is set by the DOSDIR command. It then contains the minute at which a file was created or updated.

#FILEMONTH

This variable is set by the DOSDIR command. It then contains the number of the month in which a file was created or updated.

#FILESECOND

This variable is set by the DOSDIR command. It then contains the second at which a file was created or updated.

#FILESIZE

This variable is set by the DOSDIR command. It then contains the size, in bytes, of the current file.

#FILETYPE

This variable is set by the DOSDIR command. It then contains the file attributes. Valid values are:

01 read-only
02 hidden
03 read-only and hidden
04 system
05 read-only and system
06 hidden and system
07 read-only, hidden and system
10 directory
20 archive

Using combinations of the above list, you can also define attributes 21 through 27. For example, 25 contains the following values: archive, system and read-only (20+4+1).

#FILEYEAR

This variable is set by the DOSDIR command. It then contains the year in which a file was created or updated.

#LENGTH

You can use this variable to store the length of data for which a search is to be performed or was performed.

#PARMNO

This variable contains the number of #PARM0 through #PARM9 variables that were passed to a procedure file during processing.

#ROW

This variable is set by the commands IF and WAITFOR. It then contains a number between 1 and the maximum number of rows. This number indicates the row number of the terminal emulation screen.

Local Variables with Value Type String

Variables with value type String may contain any character or a group of characters. The maximum length is 254 characters.

#ENVIRONMENT

This variable is used to obtain the value of an environment parameter. The variable is blank unless the SET command is used. The syntax of the SET command must include the name of the environment parameter from which the value is to be obtained. Example:

SET #ENVIRONMENT PATH

#FILEDRIVE

This variable is set by the DOSDIR command. It then contains the drive on which a file is located.

#FILEEXT

This variable is set by the DOSDIR command. It then contains the extension of a file name.

#FILEINFO

This variable is set by the DOSDIR command. It then contains the following file information: name, extension, size, attributes, and the day and time the file was created or updated.

#FILEMODE

This variable is set by the DOSDIR command. It then contains the file attributes:

A archive
D directory
H hidden
R read-only
S system

#FILENAME

This variable is set by the DOSDIR command. It then contains the name of a file.

#FILEPATH

This variable is set by the DOSDIR command. It then contains the directory or directories in which a file is located.

#FILESPEC

This variable is set by the DOSDIR command. It then contains the path for a file.

#FILETIME

This variable is set by the DOSDIR command. It then contains the time at which a file was created or updated.

#PARM0

This variable is set by the EXECUTE command. It then contains the name of the procedure file that is currently being executed.

#PARM1 - 9

You can use the variables #PARM1 through #PARM9 to read and write data, and to pass data to a procedure file (or to a group of nested procedure files).

#RC

The variable #RC is set by the following commands:

CD
CHDRIVE
CHMOD
DOSDIR
ERASE
MD
OPEN-I
OPEN-O
RD
READ
WRITE

The #RC variable contains a return value which indicates whether a particular command has been executed successfully.