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 Int32».
%TRUE Has the same value as «Boolean.True As Int32».

Characters

ConstantCode pointInformation
%NUL, %NULL 0 (%X0000) Null
%BEL, %BELL 7 (%X0007) Audible bell
%BS, %BACKSPC 8 (%X0008) Backspace
%HT, %TAB 9 (%X0009) Horizontal tab
%LF, %LINEFEED 10 (%X000A) Line feed
%VT, %VTAB 11 (%X000B) Vertical tab
%FF, %FORMFEED 12 (%X000C) Form feed
%CR, %RETURN 13 (%X000D) Carriage return
%ESC, %ESCAPE 27 (%X001B) Escape
%SPC, %SPACE 32 (%X0020) Space

String constants

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

Named string constants

ConstantInformationEquivalents
$T, $TAB Horizontal tab $9, $U9, $O11, $B1001
$LF, $LINEFEED Line feed $10, $U0A, $O12, $B1010
$FF, $FORMFEED Form feed $12, $U0C, $O14, $B1100
$R, $CR, $RETURN Carriage return $13, $U0D, $O15, $B1101
$E, $ESC, $ESCAPE Escape $27, $U1B, $O33, $B11011
$S, $SPC, $SPACE Space $32, $U20, $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
%INDEX In a loop of type For Each, the position of the element in the container. It starts at zero and adds one after each iteration.
$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, the same as $CONTAINER)
$SCOPE The fully qualified name of the procedure or container
$TIME The time during compilation in UTC
$TIME_12HM The time in 12-hour format ("1:37 PM")
$TIME_12HMS The time in 12-hour format ("1:37:55 PM")
$TIME_24HM The time in 24-hour format ("13:37")
$TIME_24HMS The time in 24-hour format ("13:37:55")