[Gambas-user] Method overloading in Gambas

David Paleino d.paleino at ...626...
Thu Feb 5 16:51:46 CET 2009


Hello Benoît,

On Thu, 5 Feb 2009 16:35:53 +0100, Benoît Minisini wrote:

> It is impossible to implement this kind of method overloading in Gambas. 
> 
> [..]

Ok, understood.

I probably found a trick, posting it here so that people looking at the
archives can find it :)

I'm working (yes, still) on a gb.net.ldap component, and needed this
"overloading" thing. I solved it using a Module called "LDAP" (-> static), and
a class called LDAPConnection. How to use:

---8<---
ldap AS NEW LDAPConnection

ldap.Host = ".."
ldap.Port = ".."
[..]
ldap.Connect()
--->8---

LDAPConnection has:

---8<---
PUBLIC SUB Connect()
    LDAP.Connect(ME.sHost, ME.iPort, [..])
END
--->8---

And LDAP.Connect() has the right signature and code doing stuff. Obviously one
could also call LDAP.Connect() directly.

Back to code now!

Ciao,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20090205/8a321f43/attachment.sig>


More information about the User mailing list