Skip to content

Boolean ​

Boolean is used to represent True or False values, so you use the keywords True and False to assign one of the two states to a Boolean variable.

The default value for a Boolean data type is False.

When a Boolean is represented as a numeric value, False is equal to 0 and True is equal to 1.

If a field within a DB Definition is specified as Boolean then it may require a display format for it to be correctly saved to the database. This is because the database represents the Boolean as a numeric. Use the display format 1;0 to convert the Boolean to a numeric when saving to the database.

If a field within a File Definition is specified as a Boolean then it may require a display format for it to be correctly saved to the file. You can use display formats such as 1;0 or True;False or TRUE;FALSE.

Declaration: var myvariable : boolean

The following is an example of a Boolean variable.

pascal
procedure ScriptEvent (var Value : variant);
 var myvariable : boolean;
begin
  myvariable := True; //you could also set to False
 if myvariable = True then
    loginfo('The myvariable boolean variable is true');
end;