realbasic-nug
[Top] [All Lists]

Re: Compound Statements (it works but is it OK?)

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Compound Statements (it works but is it OK?)
From: Asher Dunn <asher at fireyesoftware dot com>
Date: Sun, 30 Jan 2005 17:14:23 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <7E6C279A-6105-11D9-A4DE-000393101B4A at mobleybros dot com>

On Jan 7, 2005, at 6:40 PM, Phil M. wrote:

Experimenting around I discovered that the code below is accepted by the compiler:

    testForNil = obj <> Nil

Where:

    Dim obj As Object
    Dim testForNil As Boolean

This is obviously undocumented, so am I treading into dangerous waters? If not, will this work in RB 5.x, or even 4.5?

I do this all the time, but I generally put parentheses around the comparison to make things clearer:

testForNil = (obj <> nil)

Even though that is technically not necessary.

Asher Dunn
--------------------------------------------------------
President and Head Developer of Fireye Software <http://www.fireyesoftware.com/> Make PDFs from your RB app <http://www.fireyesoftware.com/code/pdfclasses/>
AIM and Yahoo: fireye7517
REALbasic 5.5.3 Mac OS X 10.3.7

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

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