Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
mikep wrote:You can define a conditional symbol either in your source code with a #define or using the compiler -D option.
I have been using the #Define keyword in the IDE, but I've run into a snag. One of my conditional compiles puts the application into a speed test mode, where a few global counter variables are declared, and various tasks add to the counters on each loop. The data is then output via Com1. The problem is that the #define keywords are module level, and I need it to be global.
What's the suggested method to implement a global conditional define, bearing in mind that I'm not using the command line compiler? Is it possible to define in the project file?
Don_Kirby wrote:Is it possible to define in the project file?
Yes. In addition to naming the project files, you can place nearly any command line option. This is documented in the description of a project file: http://www.zbasic.net/doc/ZBasicRef.php?page=100
I'm not sure if it's documented or not, but you can also comment out lines in the project file, using the same character ( ' ) as in the IDE. This is very useful for the conditional compile defines.