Mikroelektronika MIKROE-742 데이터 시트
PUNCTUATORS
The mikroPascal punctuators (also known as separators) are:
- [ ] – Brackets
- ( ) – Parentheses
- , – Comma
- ; – Semicolon
- : – Colon
- . – Dot
- ( ) – Parentheses
- , – Comma
- ; – Semicolon
- : – Colon
- . – Dot
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:
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); //
if (d = z) then ... // Useful with conditional statements
func(); // Function call, no arguments
function func2(n : word); //
Function declaration with parametersFor more information, refer to Operators
Precedence and Associativity, Expressions and Functions and Procedures.
Precedence and Associativity, Expressions and Functions and Procedures.
Comma
Comma (
,
) separates the arguments in function calls:
LCD_Out(1, 1, txt);
Further, the comma separates identifiers 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);
127
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroPASCAL PRO for AVR
CHAPTER 5