Integrated Dynamics - On the Dynamics of Integration

Constants and Variables

All Integrated Dynamics value types that you're used to (such as Integers, Booleans, Items, ...) are available in JavaScript, and vice versa.

The most straightforward way to create a value in JavaScript and make it available in a static Variable Card value, is by defining a variable member in JavaScript using let or const.

let defines variables that are re-assignable later in the script, such as counters. const defines variables that can not be re-assigned.

In order to use this value in a Variable Card, you need to select the variable member name inside the Scripting Terminal text editor, and then insert an empty Variable Card in the right-hand slot. You can now use this Variable Card as you're used to, such as visualizing its value in a Display Panel.

Creating variables via JavaScript is mainly useful if you need to create complex values that are not easy to create using the Logic Programmer, such as long Strings with a specific value. Below, you can find some examples of how to create such values.

const myBoolean = true;

let myInt = 123 + 456;

let myString = "";
for (let i = 0; i < 50; i++) {
  myString =+ ".";
}

const myList = [ 1, 1, 2, 3, 5 ];