Skip to main content

An introduction to conneqt variables and arrays

Variables

This short explanation covers most of the coding knowledge neccesary to use conneqt. This mostly concerns the way variables are named and what they can store.

Variables are just as the name suggests, things that can be changed. A variable stores some data that can be accessed or changed by the code. Asset properties for example are variables. But because of the coding language conneqt was written in, not all kinds of data can be stored in any variable. Instead there are variable types. Some of these are common accros languages, and thus also used by conneqt:

TypeStores
StringText, denoted between quotation marks "Text"
IntegerWhole numbers
FloatsFloating point/Decimal numbers
Bools/BooleansTrue/False statements

Furthermore, conneqt has some custom variables of its own:

Typestoresbased on
IconAn iconA string
Date and timeA date and a time, if only a date is specified it will save the time as 22:00A string
Placed insideThe higherarcial location of the assetA string
In areasA list of area variablesAn array
AreaA zone on a mapAn array
LocationA coordinateAn array
AssetA single assetAn object
AssettypeAn Asset typeA class
Flow reference / triggerA reference to a flowA reference

Arrays

Besides variables, arrays are also an important part of coding and are used within conneqt. An array is a list of variables. It is denoted by first having a variable name, folowed by square brackets: exampleArray[]. Specific variables in this list are accessed with their index number. However, it is important to know that this index number stars counting from 0: exampleArray[0] is the first item in the list, exampleArray[1] the seccond, etc. This list can only be made up from variables of the same kind within conneqt. Thus we cannot have exampleArray[0] be "ExampleString" and exampleArray[1] be 4. To use conneqt, it is not neseccary to know how to create arrays, conneqt will do this for you. However, to make proper use of node referencing, it is advantageous to know how they work.