realbasic-nug
[Top] [All Lists]

accessing nil variant properties

To: RB NUG <REALbasic-NUG at lists dot realsoftware dot com>
Subject: accessing nil variant properties
From: "Dr.Georg Christmann" <georg_christmann at yahoo dot de>
Date: Sun, 30 Jan 2005 22:54:23 +0100
Cc:
Delivered-to: REALbasic-NUG at lists dot realsoftware dot com
Hi all,

Sorry if this has already been discussed.

Regarding variants i came across the following behaviour that I believe is odd:

in an empty project I drag three pushbuttons.

pushbutton1.Action:
        dim v as Variant
        msgBox v.StringValue

pushbutton2.Action:
        dim v as Variant
        v=nil
        msgBox v.StringValue

pushbutton3.Action:
        dim v as Variant
        v="a"
        msgBox v.StringValue

In case 3 I get a msgBox showing an "a", as expected.
In case 1 and 2 I would have expected a nil object exception, instead I get an "empty" msgBox. Even the debugger says v is nil in case 1 and 2.

Is this intended behaviour?
If not: could this be related to bugreports "jwzbbxgp" or "wgfrzrru" ?

Thx.

Georg

_______________________________________________
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>