110
Compiler
© 2008 Conrad Electronic
5.3.3
Data Types
Values always are of a certain data type. Integer values (integral values; whole numbered values) in
BASIC are of the 8 Bit or 16 Bit wide data type, floating point values are always 4 byte long.
Data Type
Sign
Range
Bit
Char
Yes
-128 ... +127
8
Byte
No
0 ... 255 8
8
Integer
Yes
-32768 ... +32767
16
Word
No
0 ... 65535
16
Single
Yes
±1.175e-38 to ±3.402e38
32
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.
Additionally 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
following rules:
·
If in a linkage of 8 Bit or 16 Bit integer values one of the two data types is sign
afflicted 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.
5.3.4
Variables
Variables can take on various values depending on the
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
separated by commas:
Dim Name1, Name2, Name3 As Integer
Содержание C-Control Pro Mega Series
Страница 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Страница 9: ...VIII Inhalt 2008 Conrad Electronic ...
Страница 10: ...Part 1 ...
Страница 17: ...Part 2 ...
Страница 23: ...Part 3 ...
Страница 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Страница 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Страница 58: ...Part 4 ...
Страница 91: ...82 IDE 2008 Conrad Electronic ...
Страница 92: ...Part 5 ...
Страница 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Страница 136: ...Part 6 ...
Страница 231: ...Part 7 ...
Страница 240: ......