Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 11.2 ('Boolean')
Instant purchase and download via GumRoad!

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):

Download Icon 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.