Instructions
195 C-Control Pro IDE
© 2013 Conrad Electronic
Data Type
Sign
Range
Bit
Char
Yes
-128 ... +127
8
Byte
No
0 ... 255
8
Integer
Yes
-32768 ... +32767
16
UInteger
No
0 ... 65535
16
Word
No
0 ... 65535
16
Long (no
Mega32)
Yes
-2147483648 ... 2147483647
32
ULong (no
Mega32)
No
0 ... 4294967295
32
Single
Yes
±1.175e-38 to ±3.402e38
32
Due to size restrictions of the interpreter, 32-Bit Integer are not available on
the Mega32.
Strings
There is no explicit "String" data type. A string is based on a character array. The size of the array
must be chosen in such a way that all characters of the string fit into the character array. Addition-
ally some space is needed for a terminating character (decimal Zero) in order to indicate the end of
the character string.
Type Conversion
In arithmetic expressions it is very often the case that individual values are not of the same type. So the data types of the following expression are combined (a is of type integer variable).
a + 5.5
In this case a is first converted into the Single data type and then 5.5 is added.
The data type of the result is also Single. For data type conversion there are the follow-
ing rules:
If in a linkage of 8 Bit or 16 Bit integer values one of the two data types is sign afflic-
ted then the result of the expression is also sign afflicted.
If one of the operands is of the Single type then the result is also of the Single type. If
one of the two operands happens to be of the 8 Bit or 16 Bit data type then it will be
converted into a Single data type prior to the operation.
4.3.4 Variables
Variables can take on various values depending on the Data Type by which they have been defined.
A variable definition appears as follows:
Dim Variable Name As Type
When several variables of the same type need to be defined then these variables can be stated sep-
arated by commas: