realbasic-nug
[Top] [All Lists]

Should I be able to do this?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Should I be able to do this?
From: Karen <keatk@verizon.net>
Date: Wed, 29 Jul 2009 21:21:45 -0400
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
I thought the #if ... #EndIf block makes things that are not true in that block invisible to the complier.

If that is true one would expect to be able to use them anywhere ... But apparently that not true. The following code gives me an illegal syntax error:


    Select Case RectCtrl
    #if RBVersion <= 2009.3
     Case IsA EditField
       CheckedFont = EditField(RectCtrl).TextFont
    #endif

    #if RBVersion >= 2009.3
     Case isA TextField
       CheckedFont = TextField(RectCtrl).TextFont
     Case isA TextArea
      CheckedFont = TextArea(RectCtrl).TextFont
    #endif

    Case IsA StaticText
      CheckedFont = StaticText(RectCtrl).TextFont
    Case IsA Listbox
      CheckedFont = Listbox(RectCtrl).TextFont
    <snip>
   End Select

Is this this a bug, a design flaw, or am I crazy to even think doing this should work?

I know the work around in this case is obvious (but a pain IMO) ... I am not asking for that, just about ideally how #if ... #endif should work

- Karen

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


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