User manual
192
mikoBasic PRO for PIC32
MikroElektronika
Here’s an example:
program MyProgram
include “utils”
include “strings”
include “MyUnit”
...
For the given module name, the compiler will check for the presence of .emcl and .mbas les, in order specied by
search paths.
- If both .mbas and .emcl les are found, the compiler will check their dates and include the newer one in
the project. If the .mbas le is newer than the .emcl, then .mbas le will be recompiled and new .emcl
will be created, overwriting the old .emcl.
- If only the .mbas le is found, the compiler will create the .emcl le and include it in the project;
- If only the .emcl le is present, i.e. no source code is available, the compiler will include it as found;
- If none of the les found, the compiler will issue a “File not found” warning.
Main Module
Every project in mikroBasic PRO for PIC32 requires a single main module le. The main module is identied by the
keyword program at the beginning. It instructs the compiler where to “start”.
After you have successfully created an empty project with Project Wizard, Code Editor will display a new main module.
It contains the bare-bones of the program:
program MyProject
‘ main procedure
main:
‘ Place program code here
end.
Other than comments, nothing should precede the keyword program. After the program name, you can optionally
place the include clauses.
Place all global declarations (constants, variables, labels, routines, structures) before the label main.
Other Modules
Modules other than main start with the keyword module. Newly created blank module contains the bare-bones:
module MyModule
implements
end.
Other than comments, nothing should precede the keyword module. After the module name, you can optionally place
the include clauses.