choose

Built-ins

Canonical ID: input.choose. Nederlands: kies.

Offers a bounded set of text choices and returns exactly the selected option string. Options must be unique by exact, case-sensitive comparison and cannot be blank. The result is not an index. There is no automatic translation of option text; choose your application wording explicitly.

Signature

choose(prompt, options)

Arguments

Parameter Type Requirement
prompt Text Question displayed by the host.
options List 1–100 unique, nonblank text options.

Return value

Text.

Example

# language: en
let color = choose("Color?", ["red", "groen", "blue"])
clearCanvas(color)

The selected color fills the graphical scene; a console host still returns the selected text.

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.

ask · askNumber · askYesNo · keyDown · Programming guides · Host support · Calls and arguments