realbasic-nug
[Top] [All Lists]

Re: CallByName function in VB + WithEvents

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: CallByName function in VB + WithEvents
From: Yves Vindevogel <yves dot vindevogel at implements dot be>
Date: Wed, 30 Jun 2004 18:23:22 +0200
Delivered-to: realbasic-nug at lists dot realsoftware dot com
List-help: <mailto:realbasic-nug-request@lists.realsoftware.com?subject=help>
List-id: REALbasic NUG <realbasic-nug.lists.realsoftware.com>
List-post: <mailto:realbasic-nug@lists.realsoftware.com>
References: <791C18B0-CA34-11D8-9C0E-003065D61478 at implements dot be> <AB7FA2BE-CA37-11D8-AADC-000A95DB6C90 at fireyesoftware dot com> <4173BF67-CA39-11D8-A8A8-000A95DB6C90 at fireyesoftware dot com> <F4AD04C8-CA72-11D8-9C0E-003065D61478 at implements dot be> <9099F8D1-CAA2-11D8-99B4-000A95868802 at innernine dot com>

Maybe you should look at RBScript. If you set up a proper context class containing those functions, you could use RBScript to call them 'by name' because in RBScript you load the source as text, compile and execute. Still not what you were originally asking for, but a possible alternative.

Javascript and scirpt in general seems to be wiser on this ;-))
I'll look into that

But looking at your example I'm really not sure that it's all that useful at any rate, since all you're trying to do is adjust/compact your syntax. The simplest thing would be to just add a pair of Set/Get methods to your myObject which store the values a dictionary.

For Each Field in myRecord
        myObject.Set(Field.Name, Field.Value)
Next

Yeah, that's a possibility. I could easily create a baseObject with a Dictionary and subclass it in the others.
Instead of me.property, I can just get it out of the Dictionary.

Since the dictionary is a huge improvement over the collection, this would work

Tnx

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

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

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