Skip to main content

Value types

Every variable, argument and result holds exactly one of five kinds. A variable has no fixed type. It holds whatever was last assigned to it.

KindHoldsComes fromTruthy whenShown as (StringFormat)
Booltrue / falseliterals, comparisons, !, &&, ||, many builtinsit is truetrue / false
Integer64-bit signed whole numberinteger and hex literals, constants, integer arithmeticit isn't 042, -7
Real64-bit floating pointreal literals, any arithmetic involving a Realit isn't 0.0always six decimals: 0.500000
TextUnicode stringstring literals, + on two Texts, Text builtinsit isn't emptyas is
Windowa window handle (HWND)WindowGetActive, ContextGetWindow, WindowFindByTitle, …it isn't null0x00000000000A0B2C

"Truthy" is how if, for conditions, !, && and || read a value that isn't a Bool. It makes these everyday checks work without comparing to anything:

w = WindowFindByTitle("Calculator");
if (!w) UtilityPrint("Calculator isn't open"); // null handle is falsy

text = StringTrim(ClipboardGetText());
if (text) UtilityPrint("Clipboard has: " + text); // empty Text is falsy

There's no null, undefined or "nothing" value. A builtin that finds nothing returns an empty Text, 0, -1, false or a null Window, depending on its return kind. Check for the one it uses.