Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
189
Punctuators
The mikroBasic PRO for dsPIC30/33 and PIC24 punctuators (also known as separators) are:
 
- [ ] – Brackets 
 
- ( ) – Parentheses 
 
- , – Comma 
 
- : – Colon 
 
- . – Dot 
Brackets
Brackets 
[ ]
 indicate single and multidimensional array subscripts:
dim alphabet as byte[30]
‘ ...
alphabet[2] = “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
sub function func2(dim n as word)  ‘ Function declaration w/ 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 identifiers in declarations:
dim i, j, k as word
The comma also separates elements in initialization lists of constant arrays:
const MONTHS as byte[12] = (31,28,31,30,31,30,31,31,30,31,30,31)