MAINSAIL Language Manual, Section 36.3

previous   next   top   contents   index   framed top   this page unframed


36.3. The Get PROCEDUREs

Figure 36–1. $boGet, $iGet, $liGet, $rGet, $lrGet, $bGet, $lbGet, and $sGet
BOOLEAN
PROCEDURE   $boGet      (OPTIONAL STRING
                             
promptString,promptString2);

INTEGER
PROCEDURE   $iGet       (OPTIONAL STRING
                             
promptString,promptString2);

LONG INTEGER
PROCEDURE   $liGet      (OPTIONAL STRING
                             
promptString,promptString2);

REAL
PROCEDURE   $rGet       (OPTIONAL STRING
                             
promptString,promptString2);

LONG REAL
PROCEDURE   $lrGet      (OPTIONAL STRING
                             
promptString,promptString2);

BITS
PROCEDURE   $bGet       (OPTIONAL STRING
                             
promptString,promptString2;
                         
OPTIONAL BITS ctrlBits);

LONG BITS
PROCEDURE   $lbGet      (OPTIONAL STRING
                             
promptString,promptString2;
                         
OPTIONAL BITS ctrlBits);

STRING
PROCEDURE   $sGet       (OPTIONAL STRING
                             
promptString,promptString2);

These PROCEDUREs write a prompt to logFile and read a value. Specifically, each PROCEDURE writes promptString followed by promptString2 to logFile (there is no intervening space written between promptString and promptString2, as there is for errMsg). Then a line is read from cmdFile.

If the data type of the PROCEDURE is not STRING, leading and trailing blank space are removed from the line and the line is examined to determine whether it is a syntactically correct value for the data type returned by the PROCEDURE. If so, the STRING is converted to the data type and the value returned; if not, an error message is issued, a new prompt is written, and a new line read from cmdFile.

The STRING form ($sGet) has no error conditions; it always returns the line read from cmdFile with no modification.

The BITS and LONG BITS forms ($bGet and $lbGet) take an additional parameter ctrlBits. The valid bits in ctrlBits are binary, octal, and hex; in this case, the (LONG) BITS value read from cmdFile is expected to be of the specified radix unless the radix is overridden by a leading 'B, 'O, or 'H. If ctrlBits is not specified, the value is expected to be of the radix $preferredRadix (unless overridden).


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 36.3