Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Procedure calls

Status
Not open for further replies.

venkman

Programmer
Oct 9, 2001
467
US
I'd like to implement a function which takes in an object and a string and returns the property of that object with name that is specified by the string. For example, say my function is named foo, than the following two lines would be equivalent:

x = myObj.myProp
x = foo(myObj, "myProp")

I have an inkling on a complicated way to do this, but I wanted to see if there was a real simple way.... like is there an eval statement or something that takes in a string and runs it as if it was code?

-Venkman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top