Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
get_bool.c File Reference

VM opcode snippet for reading a boolean from an INI dictionary (OP_INI_GET_BOOL). More...

Go to the source code of this file.

Detailed Description

VM opcode snippet for reading a boolean from an INI dictionary (OP_INI_GET_BOOL).

Included by vm.c when FUN_WITH_INI is enabled.

Opcode: OP_INI_GET_BOOL Stack: [default:int|bool] [key:string] [section:string] [handle:int] -> [out:int]

Behavior

  • Pops default value (0/1), key, section, and handle.
  • Looks up the entry "section:key" in the referenced dictionary. If not found, also tries a dotted variant "section.key" for compatibility.
  • Accepts textual booleans (true/false, yes/no, on/off; case-insensitive) and numeric values (non-zero => true). Falls back to the provided default when parsing fails or entry is missing.
  • Pushes 1 for true or 0 for false.

Errors

  • Invalid handle or arguments simply yield the default value; no exception.

Definition in file get_bool.c.