Skip to content

Data Types

Extron has a lot of data types that can be used to store and manipulate data. Here are some of the data types that Extron supports:

  • String - A sequence of characters.
  • Number - A numeric data type.
    • Integer
    • Float
  • Boolean - A data type that can have one of two values: true or false.
  • Array - A collection of elements.

Data types with examples

String

  • They are a sequence of characters.
  • They can be created by enclosing characters in double quotes.
let name = "Extron";

Number

  • Numbers are either Integers or Floating point numbers.
    • Integers are whole numbers.
    • Floating point numbers are numbers with a decimal point.
let int = 12;
let float = 12.5;
print ( int + float );
 
Console 
24.5

Boolean

  • Booleans are a data type that can have one of two values: true or false.
print ( 2 > 5 );
 
Console 
false

Array

  • Arrays are a collection of elements.
  • They can store elements of any data type.
  • They can be created by enclosing elements in square brackets.
  • Arrays can be indexed by their position in the array.
    • Arrays are 0-indexed.
let arr = [1, 2, 3, 4, 5];
print ( arr[2] );
 
set arr = [ "Extron", 12, true ];
print ( arr[0] );
 
Console 
3
Extron