MAINSAIL Language Manual, Section 32.48

previous   next   top   contents   index   framed top   this page unframed


32.48. $compileTimeValue

Figure 32–47. $compileTimeValue
SPECIAL COMPILETIME
STRING
PROCEDURE   $compileTimeValue
                        (
STRING valueName);

The argument of the special COMPILETIME PROCEDURE $compileTimeValue must be a STRING constant that consists of a keyword, possibly followed by arguments if the keyword takes arguments. Case is not distinguished in the keywords.

For each of the following keywords, the result is "TRUE" if the compiler option is in effect, else the empty STRING:

ALIST DEBUG FLDXREF GENCODE GENINLINES INCREMENTAL ITFXREF
LOG MODTIME PERMOD PERPROC PERSTMT PROCS PROCTIME
RECOMPILE RESPONSE SAVEON SLIST STRICTCLASSES UNBOUND

The effects of the following keywords are described in Chapter 17:

OPTIMIZE CHECKINGSTATUS LOCALCHECKINGSTATUS ACHECKINGSTATUS
LOCALACHECKINGSTATUS

$compileTimeValue("MONITOR") is "TRUE" if and only if:

$compileTimeValue("PERMOD") AND
$compileTimeValue("PERPROC") AND
$compileTimeValue("PERSTMT") AND
$compileTimeValue("PROCTIME") AND
$compileTimeValue("MODTIME")

$compileTimeValue("VERSION") returns a STRING in the form:

majorVersion.[minorVersion]

representing the current MAINSAIL version, e.g., "16.20".

$compileTimeValue("FLI") is the FLI specification given to the FLI subcommand (e.g., TC, FP) if the current compilation is for an FLI, or the empty STRING if the current compilation is not an FLI compilation.

$compileTimeValue("RPC") returns:

""          if the compilation is not an RPC compilation
"
C"         if the compilation is a C RPC compilation
"
MAINSAIL"  if the compilation is a MAINSAIL RPC compilation

$compileTimeValue("ERRORS") is "TRUE" if any errors have occurred in the current compilation, the empty STRING otherwise.

$compileTimeValue("THISFILENAME") is the name of the current source file, i.e., is equivalent to $thisFileName.

$compileTimeValue("SOURCEFILE") returns the name of the file that sourcefiled the current file, if it was sourcefiled; otherwise, it returns the null STRING.

$compileTimeValue("SOURCEFILE fileName") returns "TRUE" if the named file can be opened as a text file; otherwise, it returns the null STRING. This is useful to know whether or not the current file is being used as a SOURCEFILE, and could be used for deciding, e.g., whether to compile a header (if being sourcefiled) or a MODULE (if being compiled as a top-level file).

$compileTimeValue("THISMODULENAME") is the uppercase name of the MODULE being compiled, or the null STRING if the initial BEGIN and MODULE name of a MODULE have not yet been encountered.

$compileTimeValue("THISPROCEDURENAME") is the name of the PROCEDURE currently being compiled, or the null STRING if a PROCEDURE body is not being compiled.

$compileTimeValue("THISPAGENUMBER") is the current source file page number (where pages are delimited by eop characters).

$compileTimeValue("THISLINENUMBER") is the current source file line number relative to the start of the current page.

$compileTimeValue("THISABSLINENUMBER") is the current source file line number relative to the start of the file.

$compileTimeValue("DATEANDTIME") is the current date and time in the format:

{d}d-mmm-yyyy hh:mm:ss

$compileTimeValue("DATEANDTIME") recomputes the date and time for each call.

$compileTimeValue("RESTOREFROM fileOrModuleName") returns "TRUE" if it is possible to perform a RESTOREFROM from the named file or MODULE, otherwise the null STRING. No RESTOREFROM is actually done.

$compileTimeValue("HASBODY procedure") is "TRUE" if procedure is the name of a PROCEDURE of which the body has been parsed during this compilation, the null STRING otherwise. The test:

NOT $compileTimeValue("HASBODY procedure")

differs from:

NEEDBODY(procedure)

in that the latter is TRUE only if the PROCEDURE has been declared as FORWARD and called (or is an interface PROCEDURE of the current MODULE), but not given a body; the former is TRUE if and only the PROCEDURE has not been given a body, regardless of whether it has been declared as FORWARD or called.


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 32.48