realbasic-plugins
[Top] [All Lists]

Can't overload a function in a plugin, but can in RB?

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Can't overload a function in a plugin, but can in RB?
From: "Theodore H.Smith" <delete at elfdata dot com>
Date: Sat, 29 Jan 2005 17:03:17 +0000
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
I want to overload a function from my plugin. I want it to be able to take 3 possible types. This is a dictionary function. "ElfDataDictionary.Value(Key) as object"

Here are the types I want:

ElfData
Object
Integer

ElfData is just text data. Object will be treated as a key, just like RB's dictionary does. And Integer too will be treated as a key.

This works in RB, but if I try to call this from a plugin based code, then I get told that the code calling it, is ambiguous.

Is my comparison wrong? (Maybe I missed something).

Or is RB acting inconsistantly?


This code, added to the app class of a new project, seems to compile fine:

Private Function value(o as object) As object
   Break
End Function
Private Function value(a as app) As object
   Break
End Function
Private Function value(i as integer) As object
   Break
End Function

I can call this code fine, like this:

  me.value( window1 ) = me.value( window1 )
  me.value( 1 ) = me.value( me )


What's up?

--
   Theodore H. Smith - www.elfdata.com/plugin/ - www.elfdata.com/forum/
   ElfData: Industrial strength string processing, made easy.

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