Skip to main content Link Search Menu Expand Document (external link)

standard.setVar

description

Stores the current value of the element in the Var element named varName (if it exists).

syntax

getX(ELEMENT_NAME).setVar(varName)

What does getX() mean?

  • varName :

notes

  • What the current value corresponds to is specific to each element type:

since

beta 0.3

example(s)


@
$newVar("name")
@,
@newTextInput("nameInput", "What is your name?")
@    .once()
@    .print()
@    .wait()
$    .setVar("name")
@,
@newText("helloname")
@    .before( newText("hello", "Hello") )
$    .text( getVar("name") )
@    .print()
  • Creates a Var element named name and adds a text box in which to enter a name. When the return/enter key is pressed while editing the input box, it disables the box and stores its value in the Var element named name. Then it prints a text reading Hello name, where name corresponds to the value of the Var element.