img

Data Types

The NetTradeX language has the following built-in data types:

Data type:Range:Description:
int8от -128 до 127Integer data types
int16from -32768 to 32767
intfrom -2147483648 to 2147483647
int64from -9223372036854775807 to 9223372036854775807
uint8from 0 to 255Unsigned integer data types
uint16from 0 to 65535
uintfrom 0 to 4294967295
uint64from 0 to 18446744073709551615
floatfrom -3.402823466e+38 to 3.402823466e+38Float data types
doublefrom -1.7976931348623158e+308 to 1.7976931348623158e+308
booltrue, falseLogical data type
colorfrom 0x000000 to 0xFFFFFFColor constant
stringnot applicableThe sequence of characters enclosed in quotation marks
datetimefrom 0 to 2147483647 Data type for storing time/date

The name of each type is a keyword and cannot be used as an identifier.

When compiling scripts the conversion of the data from one type into another may be needed. To do this, use the following syntax: new_type_variable = new_type (variable_of_the_converted_type);
Example:

 int Run() { int8 a = 33; System.Print("a="+a); // Displayed a=! System.Print("a="+int(a)); // Displayed a=33 return (0); } 

The keyword extern is used for the declaration of global variables, extern should be placed before the type of a variable. Global variables are accessible from any part of a script.

Example of declaration of a global variable:

 extern int openDeals = 0;