User manual

mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
189
Brackets
Brackets [ ] indicate single and multidimensional array subscripts:
var alphabet : array[1..30] of byte;
// ...
alphabet[3] := ‘c’;
For more information, refer to Arrays.
Parentheses
Parentheses ( ) are used to group expressions, isolate conditional expressions and indicate function calls and
function declarations:
d := c * (a + b); // Override normal precedence
if (d = z) then ... // Useful with conditional statements
func(); // Function call, no arguments
function func2(n : word); // Function declaration with parameters
For more information, refer to Operators Precedence and Associativity, Expressions and Functions and Procedures.
Comma
Comma (,) separates the arguments in function calls:
LCD_Out(1, 1, txt);
Furthermore, the comma separates identiers in declarations:
var i, j, k : byte;
The comma also separates elements of array in initialization lists:
const MONTHS : array[1..12] of byte = (31,28,31,30,31,30,31,31,30,31,30,31);
Semicolon
Semicolon (;) is a statement terminator. Every statement in Pascal must be terminated with a semicolon. The exceptions
are: the last (outer most) end statement in the program which is terminated with a dot and the last statement before
end which doesn’t need to be terminated with a semicolon.
For more information, see Statements.