realbasic-betas.mbox
[Top] [All Lists]

Re: Generic #ifdef wuvczsfm

To: REALbasic Betas <realbasic-betas at lists dot realsoftware dot com>
Subject: Re: Generic #ifdef wuvczsfm
From: Will Leshner <will dot leshner at gmail dot com>
Date: Tue, 27 Jul 2004 19:54:57 -0700
Delivered-to: realbasic-betas at lists dot realsoftware dot com
References: <BD2BC6C9 dot 314C%mac-x at mac-x-software dot com> <026f01c47447$6f4995d0$2be15340 at Circe>
On Tue, 27 Jul 2004 21:06:01 -0500, Aaron Ballman
<aaron at realsoftware dot com> wrote:
> > I just try in RB 5.5.3f5, but doesn't work. Witch version of RB 5.x is
> > implemented ?
> 
> I believe that was in 5.0.
> 
> You can use generic #if to conditionally compile code like this:
> 
> Const test = true
> 
> #if test
>     MsgBox "Test"
> #endif
> 
> If you set test to false, you will get no MsgBox.

Actually, that existed at least as far back as 4.5.3 and I really
think it pretty much existed forever. But that's not what the feature
request was requesting. What was requested was a way to test whether a
symbol exists or not. For example, let's say you've declared a method
called Foo() in a module and you want to test whether Foo() exists or
not. That's so you can write code that will work even if the module
containing Foo() might not be included in your project. So if we had a
#ifdef we could conditionally compiler depending on whether or not
that symbol existed.

-- 
REALbasic database options: http://sqlabs.net
REALbasic news and tips: http://rbgazette.com
Simple weblog publishing: http://kidzlog.com
_______________________________________________
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>