Calling Class Method / Property with String Variable 
Author Message
 Calling Class Method / Property with String Variable

Yo,

Using 5.0...say I have an object A and a string variable containing a name
of one of A's methods / properties.  Is it possible to call the method using
this string??

For instance, say I have a reference to objUser and a string variable
"ID"...is it possible to call objUser.ID without knowing any of objUser's
methods / properties beforehand (ie, without hardcoding a Select...Case).

Just wondering, thanks...
Frank



Tue, 24 Apr 2001 03:00:00 GMT  
 Calling Class Method / Property with String Variable
There may be someway to do so using API or something, but nothing built into
VB. You would have to get Version 6.0 where we now have the CallByName
function.

--

Aaron





Quote:
>Yo,

>Using 5.0...say I have an object A and a string variable containing a name
>of one of A's methods / properties.  Is it possible to call the method
using
>this string??

>For instance, say I have a reference to objUser and a string variable
>"ID"...is it possible to call objUser.ID without knowing any of objUser's
>methods / properties beforehand (ie, without hardcoding a Select...Case).

>Just wondering, thanks...
>Frank



Tue, 24 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Public Method in a class calling a private method in same class yields ByRef error

2. I'd use string methods more if string were a structure and not a class

3. How to call one VB class module method from another class in an ActiveX dll

4. WISHLIST: New Method for string class

5. Access to the datatypes of a property's or a method's class

6. tool tips on class methods, properties, etc.

7. How to set a description for my methods and properties in my classes

8. A Class without Properties & Methods

9. Get property and method from class

10. VC++ Class properties/method access in VB program?

11. how to create class in vbscript ( methods and properties)

12. VC++ Class properties/method access in VB program?

 

 
Powered by phpBB® Forum Software