started
Canonical ID: events.started. Nederlands: gestart.
Starts its event block once the program’s initialization is finished. Initialization means running the ordinary instructions at top level, outside functions and event blocks. started() is an event descriptor: it belongs directly after when and cannot be used as an ordinary call.
If there are several started blocks, Pliro queues them in the order written. Put an ongoing animation loop in a started block when other event blocks need turns during its positive waits. A never-ending loop in ordinary top-level setup would prevent the event blocks from starting at all.
Signature
when started():
Arguments
This call takes no arguments. Always write the parentheses.
Return value
Event descriptor.
Example
# language: en
let score = 0
when started():
set score = score + 1
say score
Prints 1 after initialization.
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.
An event descriptor selects the event in a top-level when header, outside other blocks (E3201–E3203). A reporter is an ordinary function that returns a value, such as pointerX; broadcast is an ordinary call too. A handler is the block reacting to an event. Key and pointer handlers keep a run ready for future input and need host support (E4019). Pointer reporters need the current pointer event (E4020). The whole run has a shared event-work limit (E4018). Ordinary setup must finish before handlers get turns. See event rules and pointer positions.
Related entries
after · messageReceived · keyPressed · pointerPressed · pointerReleased · Programming guides · Host support · Calls and arguments
