scale.wait

getScale(id).wait()

or getScale(id).wait("first")

or getScale(id).wait(test)

Waits until one of the buttons is clicked before evaluating and executing the next commands.

If you call wait("first"), then if a button is already selected when this command is evaluated, the next commands are evaluated and executed right away. If no button in the scale was clicked before, the next commands are only evaluated and executed after a button is clicked.

If you pass a test on an element as an argument, it only evaluates and executes the next commands when a button is clicked while the test is successful. If the test is not successful, it will be checked again upon the next click.

[js highlight=”5″ try=”true”]newScale(“hunger”, 5)
.settings.before( newText(“left”, “Right now, I am… very hungry “) )
.settings.after( newText(“right”, ” not hungry at all”) )
.print()
.wait()[/js]

Adds a 5-point radio scale to the screen and waits for a click on one of its buttons.