Mikroelektronika MIKROE-724 データシート

ページ / 726
142
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
at keyword
You can use the keyword “at” to make an alias to a variable, for example, you can write a library without using register 
names, and later in the main program to define those registers, for example:
module MyModule
   
dim PORTAlias as byte external ‘ here in the library we can use its symbolic name
...
implements
...
end.
program MyProgram
...
dim PORTAlias byte as at PORTB ‘ this is where PORTAlias is fully defined
...
main:
...
end.
Note: Bear in mind that when using 
at
 operator in your code over a variable defined through a 
external
 modifier, 
appropriate memory specifer must be appended also. 
bit type
The mikroBasic PRO for dsPIC30/33 and PIC24 compiler provides a 
bit
 data type that may be used for variable 
declarations. It can not be used for argument lists, and function-return values.
dim bf as bit  ‘ bit variable
There are no pointers to bit variables:
dim ptr as ^bit     ‘ invalid
An array of type bit is not valid:
dim arr as array[5] of bit     ‘ invalid 
Note
- Bit variables can not be initialized. 
- Bit variables can not be members of structures and unions. 
- Bit variables do not have addresses, therefore unary operator 
@
 (address of) is not applicable to these variables. 
Related topics: Predefined globals and constants, External modifier