User manual

mikroBasic PRO for PIC32
MikroElektronika
201
Types
Basic is strictly typed language, which means that every variable and constant need to have a strictly dened type,
known at the time of compilation.
The type serves:
- to determine the correct memory allocation required,
- to interpret the bit patterns found in the object during subsequent accesses,
- in many type-checking situations, to ensure that illegal assignments are trapped.
mikroBasic PRO for PIC32 supports many standard (predened) and user-dened data types, including signed and
unsigned integers of various sizes, arrays, strings, pointers and structures.
Type Categories
Types can be divided into:
- simple types
- arrays
- strings
- pointers
- structures
Simple Types
Simple types represent types that cannot be divided into more basic elements and are the model for representing
elementary data on machine level. Basic memory unit in mikroBasic PRO for PIC32 has 16 bits.
Here is an overview of simple types in mikroBasic PRO for PIC32:
You can assign signed to unsigned or vice versa only using the explicit conversion. Refer to Types Conversions for
more information.
Type Size Range
bit
1–bit 0 or 1
sbit
1–bit 0 or 1
byte, char
8–bit 0 .. 255
short
8–bit -127 .. 128
word
16–bit 0 .. 65535
integer
16–bit -32768 .. 32767
longword
32–bit 0 .. 4294967295
longint
32–bit -2147483648 .. 2147483647
oat
32–bit ±1.17549435082 * 10
-38
..
±6.80564774407 * 10
38
int64
64–bit -9223372036854775808 ..
9223372036854775807
uint64
64–bit 0 .. 18446744073709551615