INPUT /  OUTPUT /  LANGUAGE





onGet field

Code field

Code carried out when a scalar is read. Whatever the code generates is used as the value read.

Applies to...

The scalar tag.

Sample usage

Behaviour

A code field: holds code to be carried out each time the event happens. Add code after the tag is created with .push.

When a scalar with an onGet field is read, the code is carried out, and the values it generates are used instead of the scalar's stored value. If the code generates nothing, reading the scalar generates nothing.

Notes

A scalar with onGet can be used like a function: write its name wherever the code should run.

See also