Language Elements
50
NetLinx Programming Language Reference Guide
Data Types
Intrinsic types
The following table lists the data types inherently supported by the NetLinx language.
Type conversion
Although explicit type casting is not supported in the NetLinx language, the compiler is forced to do type
conversion in situations where an arithmetic assignment or other operation is defined with constants and/
or variables having mixed data types. Type conversions will occur under the following circumstances:
 A value of one type is assigned to a variable of another type.
 A value passed as a parameter to a subroutine does not match the declared parameter type.
 The value returned by a subroutine does not match the declared return type.
Type conversion rules
 If the expression contains a 32 or 64-bit floating-point variable or constant, all variables and
constants in the expression are converted to 64-bit floating point before resolving.
 If the expression contains only whole number value variables and constants, all variables and
constants in the expression are converted to 32-bit integers before resolving.
 If type conversion is required for an assignment or as a result of a parameter or return type
mismatch, the value is converted to fit the type of the target variable. This may involve
truncating the high order bytes(s) when converting to a smaller size variable, or sign
conversion when converting signed values to unsigned or vice versa.
NetLinx Intrinsic Data Types
Keyword Data Type Sign Size Range
CHAR Byte Unsigned 8-bit 0 - 255
WIDECHAR Integer Unsigned 16-bit 0 - 65535
INTEGER Integer Unsigned 16-bit 0 - 65536
SINTEGER Integer Signed 16-bit -32768 to +32768
LONG Long Integer Unsigned 32-bit 4,294,967,295
SLONG Long Integer Signed 32-bit + 2,147,483,647
FLOAT Floating Point Signed 32-bit 1.79769313 E
+308
to 2.22507385 E
-308
DOUBLE Double Precision
Floating Point
Signed 32-bit 3.40282347 E
+38
to 1.17549435 E
-38