User manual

mikroPascal PRO for PIC32
MikroElektronika
213
begin
a := 241;
b := 128;
cc := a + b; // equals 113
cc := word(a + b); // equals 113
dd := a + b; // equals 369
ptr := TBytePtr(@arr);
ptr := ^byte(@arr);
end.
Type Specier
The specier type introduces a synonym for a specied type. The type declarations are used to construct shorter or
more convenient names for types already dened by the language or declared by the user.
The specier type stands rst in the declaration:
type synonym = <type_denition>;
The type keyword assigns synonym to <type_denition>. The synonym needs to be a valid identier.
A declaration starting with the type specier does not introduce an object or a function of a given type, but rather a
new name for a given type. In other words, the type declaration is identical to a “normal” declaration, but instead of
objects, it declares types. It is a common practice to name custom type identiers with starting capital letter this is
not required by the mikroPascal PRO for PIC32.
For example:
// Let’s declare a synonym for “byte”
type Distance = byte;
// Now, synonym “Distance” can be used as type identier:
var i : Distance; // declare variable i of byte