Pre-Calculated Constants

ViviFire supplies many constants that can give your code better portability and make it easier to read. These constants can have one of two data types—integer or string.

Integer constants

Integer constants start with a percent symbol (%).

ConstantInformation
%EXIT_FAILURE Use with «Exit Program» to stop a program because of an error.
%EXIT_SUCCESS Use with «Exit Program» to stop a program without errors.
%FALSE Has the same value as «Boolean.False As Int».
%TRUE Has the same value as «Boolean.True As Int».

Characters

ConstantCode pointInformation
%NUL, %NULL 0 (&H0000) Null
%A, %BEL, %BELL 7 (&H0007) Audible bell
%B, %BS, %BACKSPC 8 (&H0008) Backspace
%T, %TAB 9 (&H0009) Horizontal tab
%LF, %LINEFEED 10 (&H000A) Line feed
%V, %VT, %VTAB 11 (&H000B) Vertical tab
%FF, %FORMFEED 12 (&H000C) Form feed
%R, %CR, %RETURN 13 (&H000D) Carriage return
%E, %ESC, %ESCAPE 27 (&H001B) Escape
%S, %SPC, %SPACE 32 (&H0020) Space

String constants

String constants start with a dollar symbol ($). For the syntax of string constants, see String Basics.

Named string constants

ConstantInformationEquivalents
$T, $TAB Horizontal tab $9, $H9, $O11, $B1001
$LF, $LINEFEED Line feed $10, $HA, $O12, $B1010
$FF, $FORMFEED Form feed $12, $HC, $O14, $B1100
$R, $CR, $RETURN Carriage return $13, $HD, $O15, $B1101
$E, $ESC, $ESCAPE Escape $27, $H1B, $O33, $B11011
$S, $SPC, $SPACE Space $32, $H20, $O40, $B100000
$N, $NL, $NEWLINE Newline (Platform-controlled)
$PD, $PARENTDIR Parent directory (Platform-controlled)
$PS, $PATHSEP File path separator ""/"", ""\""
$RD, $ROOTDIR Root directory (Platform-controlled)

Magic constants

Some constants have different values because of their location or when something occurred.

ConstantInformation
$DATE The date during compilation in UTC
$DATE_DMY The date in DD-MM-YYYY format
$DATE_MDY The date in MM-DD-YYYY format
$DATE_YMD The date in YYYY-MM-DD format
$FILE The name of the source file
$LINE The line number in the source file
$CONTAINER The name of the class, object, trait, or module
$PROC The name of the procedure (or if not in a procedure, then the same as $CONTAINER)
$SCOPE The fully qualified name of the procedure or container
$TIME The time during compilation in UTC
$TIME_12 The time in 12-hour format ("1:37 PM")
$TIME_12_SEC The time in 12-hour format ("1:37:55 PM")
$TIME_24 The time in 24-hour format ("13:37")
$TIME_24_SEC The time in 24-hour format ("13:37:55")