Compiler Directives:
"Pro" And
"Ultra"
As of 2007 April, Pro and Ultra have been added to SiMPLE's list of compiler directives. (Compiler directives are non-executable statements supplying the compiler with directions for its operation. In SiMPLE, compiler directives are similar to keywords in that they always begin with an upper-case letter.)
As you know, SiMPLE exists in two slightly different "universes" -- "Pro-SiMPLE", and "Ultra-SiMPLE". When using SiMPLE in command-line mode, you can easily switch between these two universes by merely typing either a "PRO" command or an "ULTRA" command. (This then establishes the "default" universe for your programs.)
When using SiMPLE in "Drag & Drop" mode, programs will compile in the default universe that was most recently established by either a "PRO" command-line command or an "ULTRA" command-line command.
The Pro compiler
directive and
Ultra
compiler directive provide a convenient way of selecting the desired universe
for programs that are being run in "Drag & Drop" mode. (Otherwise, you would first
have to go into command-line mode and issue either a
"PRO" command
or an "ULTRA" command every time
you wanted to change universes.) Instead, simply include either a
Pro compiler
directive or an
Ultra
compiler directive in your listing:
// //
// My DOS program // My Win program
// //
Pro Ultra
Call Sound (440) id = open mci ("song.mid")
Call Delay (100) start mci (id)
--- (etc.) --- --- (etc.) ---
This will force the specified universe regardless of its current default setting. (The
Pro compiler
directive or the
Ultra
compiler directive can be placed anywhere in your listing. But it's a good idea to
put it near the beginning where it can be easily seen.)
Any characters following the "Pro" and "Ultra" are ignored
(unless a "[" character, a "]" character, or an asterisk character is present).
Therefore you may optionally
use the terms "Pro-SiMPLE" and "Ultra-SiMPLE" as the compiler directives:
// //
// My DOS program // My Win program
// //
Pro-SiMPLE Ultra-SiMPLE
Call Sound (440) id = open mci ("song.mid")
Call Delay (100) start mci (id)
--- (etc.) --- --- (etc.) ---
By including the full name of the intended universe at the beginning of your program listing,
it helps create a nice "header" for the listing.
If a Pro compiler directive or an Ultra compiler directive is encountered in a program that is being run in command-line mode, the compiler will check to see if it matches the current universe.
It's a good idea to always include either a Pro compiler directive or an Ultra compiler directive at the beginning of every program listing, unless the program is intended to run correctly in either universe. Such "Either/Or" programs (ones that do not contain either of the two compiler directives) will then compile in whichever default universe was set.
[
Webmaster |
FAQ's |
Home Page |
Contact Us ]