Article Preview
Buy Now
COLUMN
Get Your Pragma On
Conditional Compiling and Pragma Directives
Issue: 11.2 (March/April 2013)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 18,816
Starting Page Number: 60
Article Number: 12109
Resource File(s):
12109 project.zip Updated: 2013-03-04 13:32:48
Related Link(s): None
Excerpt of article text...
Two powerful features of Real Studio that many beginners overlook are Pragma Directives and Conditional Compiling. Both of these sound esoteric and non-essential, but they're not especially difficult to use and can be quite helpful even if you're just getting started.
Conditional Compiling
Conditional compiling may sound complicated, but it's just a way to control which code gets used in which circumstances. It works with the familiar
if-then-else-endif
structure, except the commands are preceded by a number sign (as in#if-then-#else-#endif
).The most obvious and common use for conditional compiling is to restrict platform-specific code to a specific platform. For instance, if you want to use a Mac-only function, you'd want to enclose that code with conditional compiling commands like this:
...End of Excerpt. Please purchase the magazine to read the full article.