Dot Variables

Dot variables, so named because they begin with a period (dot), are read-only system variables useful for retrieving certain kinds of information like the date, program name, etc. In many cases, the same information is available via other methods, such as XCALLs, but the dot variable approach is generally the most elegant, efficient, and transparent. They were originally considered part of the d/Basic extensions (COMPIL /D), because most of them originated with d/Basic. But over time, A-Shell has added its own dot variables and they are now available as part of the A-Shell extensions (COMPIL/X:2).

Extension

Notes

.ACCOUNT

Evaluates to the user’s current ppn (e.g. "100,22").

.ARGCNT

Number of parameters passed in the last function, procedure call, or SBX.

.DATE

Returns the date as a decimal number which displays as MMDDYY. So March 16, 2009 should return the numeric value 31609.

.DEVICE

Evaluates to the user’s current device (e.g. "DSK0:")

.EXPERIENCE

Evaluates to the numeric value 100 (since "experience" level is not one of the AMOS job attributes that is emulated under A-Shell).

.FALSE

.TRUE and .FALSE may be used as self-documenting replacements for -1 and 0.

.JOBNAME

Evaluates to the jobname.

.LAST_LABEL

Name of last label passed. Requires ++PRAGMA TRACK_LAST_LABEL. 

.LAST_ROUTINE

Name of last called function or procedure. Requires ++PRAGMA TRACK_LAST_ROUTINE.

.LINENO

Returns the last line number, similar to err(1) except without requiring an error. Not to be confused with the dot function .LINENO(ch) (which returns the physical line # since the last page break in the output file open on the specified channel).

.LOCATION

Returns the current program location counter, i.e. the offset in bytes from the start of the current program (RUN, LIT or SBX) to the current statement position. Note that the location counter is generally represented in hex (as it appears in the LSX files created by the compiler /LF switch), so you would probably want to print it using the SOSLIB function Fn'Dec2Hex(.LOCATION).

.MONTH

Evaluates to the 3 character abbreviation for the current month.

.NEST_LEVEL

Number of levels deep with nested function/procedure calls.

.NULL

May be used with sequential files to open a file which is not connected to anything.

.PGMNAME

Evaluates to the current program name.  

.PGMVERSION

Evaluates to the current program version (e.g. "1.2A(100)").

.TERMINAL

Evaluates to the current TRMDEF name.

.TIME

Evaluates to the current time, in HHMMSS format.

.TRUE

.TRUE and .FALSE may be used as self-documenting replacements for -1 and 0.

.USERNAME

Evaluates to the user name.  

.YYMMDD

Evaluates to the current date in YYMMDD (string) format.  

 

History

2016 December, A-Shell 6.3.1538, compiler edit 792:  Add .LINENO and .LOCATION

2016 September, A-Shell 6.3.1524:  Add special file name .NULL

2014 October, A-Shell 6.1.1391, compiler edit 710:  Add .TRUE and .FALSE

2006 October, A-Shell 4.9.969:  Add .LAST_LABEL, .LAST_ROUTINE, .ARGCNT, .NEST_LEVEL

1997 August, A-Shell 4.2.555:  Add .TERMINAL, .JOBNAME, .USERNAME, .ACCOUNT, .DATE, .TIME, .PGMNAME, .PGMVERSION, .MONTH