Data Types; Intrinsic Types; Type Conversion; Type Conversion Rules - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Language Elements

Data Types

Intrinsic types

The following table lists the data types inherently supported by the NetLinx language.
NetLinx Intrinsic Data Types
Keyword
CHAR
WIDECHAR
INTEGER
SINTEGER
LONG
SLONG
FLOAT
DOUBLE

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:

Type conversion rules

50
Data Type
Sign
Byte
Unsigned
Integer
Unsigned
Integer
Unsigned
Integer
Signed
Long Integer
Unsigned
Long Integer
Signed
Floating Point
Signed
Double Precision
Signed
Floating Point
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.
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.
Size
Range
8-bit
0 - 255
16-bit
0 - 65535
16-bit
0 - 65536
16-bit
-32768 to +32768
32-bit
4,294,967,295
32-bit
+ 2,147,483,647
+308
32-bit
1.79769313 E
to 2.22507385 E
+38
32-bit
3.40282347 E
to 1.17549435 E
NetLinx Programming Language Reference Guide
-308
-38

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents