realbasic-nug
[Top] [All Lists]

Re: Overloading in RB 5

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Overloading in RB 5
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Thu, 20 Mar 2003 08:35:13 -0800
At 10:12 AM -0500 3/20/03, Charles Yeomans wrote:

I have found a few glitches, though.  You cannot do the following.

Sub Foo(v as Variant)
Sub Foo(obj as Object)

Well sure, since a Variant is an Object, and so it's just like this case:

Now, you also cannot do the following.

Sub Foo( obj as Object)
Sub Foo(w as Window)

There you go.

But this makes sense, because here the overloading is ambiguous. But a Variant is not an Object

Here's your mistaken assumption (or perhaps it's documented incorrectly?).

, not is an Object a Variant, so it seems to be that the first code snippet should compile.

(Bug ID = guqrdpth)

I assume you have no objection if we close this feedback record?

Next, suppose you define Sub Foo(v() as Variant). Then the following code compiles.

dim list(-1) as String
Test list

What is Test?  Did you mean to define Sub Test?

But the following code does not.

dim list(-1) as Object
Test list

I'm surprised either one compiles -- I didn't think we could convert an array of something else into an array of variants.

Best,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>

Subscribe to the digest: <mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.


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