askYesNo
Canonical ID: input.readBoolean. Nederlands: vraagJaNee.
Asks a yes/no question and returns a Boolean. Graphical hosts provide bounded choices. Console replies accept true/yes/y/waar/ja/j/1 and false/no/n/onwaar/nee/0, ignoring letter case and surrounding whitespace. Use the Boolean directly in a condition instead of comparing it with text.
Signature
askYesNo(prompt)
Arguments
| Parameter | Type | Requirement |
|---|---|---|
prompt |
Text | Question displayed by the host. |
Return value
Boolean.
Example
# language: en
let ready = askYesNo("Start?")
if ready:
say "A"
else:
say "B"
Yes selects A; no selects B.
Notes and common mistakes
Use the function name for your source language. Its canonical ID is a shared documentation label; you do not type that ID as a call. Giving your own variable or function the same name can hide the built-in. Supply the documented arguments and value types. Pliro reports mismatches when checking can detect them, or when the call runs.
The selected host mediates input. Program replies are bounded to 64 KiB of valid UTF-8; unavailable input produces E4010. Keyboard names and option strings are data and are not translated with source syntax. Completed prompts are cooperative checkpoints.
Related entries
ask · askNumber · choose · keyDown · Programming guides · Host support · Calls and arguments
