What are variables? | Aquro Help Center

Variables are used in Visual Coding (VC) to temporarily store data that should be used later on in the VC script. 

Adding and working with variables is done in the coding block configuration window.

In the Visual Coding there are three different kind of variables.

Value Variable

Used for all parameters that accept or return the type 'Value'. Often used for text strings or numbers

To add a value variable follow these steps:

  1. Click ADD VARIABLE  in the top right
  2. Click on VALUE VARIABLE
  3. Enter a name for your variable
  4. Click on ADD
  5. The new variable should now appear in the list

Data object

An instance of a data item with a specific class. When working with data object variables, they will not belong directly to any collection and so you will need to add them to a collection if would like to save and utilize them.

To add a data object variable follow these steps:

  1. Click ADD VARIABLE  in the top right
  2. Click on DATA OBJECT VARIABLE
  3. Enter a name for your variable
  4. Select the model that this object should have
  5. Click on ADD
  6. The new variable has now been added and is shown in the list

Component reference

The final type of variable is a component reference, and is used when working with UI components.

To add a component reference variable follow these steps:

  1. Click ADD VARIABLE  in the top right
  2. Click on COMPONENT REFERENCE
  3. Enter a name of your variable
  4. Click on ADD
  5. The new variable have now been added and is shown in the list