Language Reference - Textual Language - Evaluation Rules


The JGrafchart textual language uses loose typing and automatic type-casting. It is the context that decides how an expression is evaluated. An expression can be evaluated as a bool, an int, a real, or a string.

Type Conversions

From To Conversion rules
bool int false → 0, true → 1.
bool real false → 0.0, true → 1.0.
bool string false → "0", true → "1".
int bool 1 → true, false otherwise.
int real Ordinary cast.
int string The int value as a string.
real bool If the value cast to an int is 1 then true, otherwise false.
real int Ordinary cast.
real string The real value as a string.
string bool "1" → true, false otherwise.
string int The parsed int value if possible, 0 otherwise.
string real The parsed real value if possible, 0.0 otherwise.