I may be overthinking this and missing an obvious way, but how do I treat a string as code to be executed?
For instance, say I have a string containing "Call SomeFunction(Param, Param2)"; how do I then actually execute the code contained in the string?
You would need to implement scripting. I do not believe that this is otherwise inherently supported in Visual Basic; in JavaScript or PHP, you can use the eval() function to treat a string as code.
not without using the microsoft script control (http://www.microsoft.com/downloads/details.aspx?FamilyId=D7E31492-2595-49E6-8C02-1426FEC693AC&displaylang=en).
You might be able to use CallByName
>:(
Doesn't look like CallByName would work for what I want.
Guess I'm going to have to skip this and find some complicated way to do it, thanks.
Quote from: Soul Taker on November 25, 2004, 06:49 AM
>:(
Doesn't look like CallByName would work for what I want.
Guess I'm going to have to skip this and find some complicated way to do it, thanks.
Well what is it you're really trying to accomplish? Perhaps it can be done in way to use CallByName?
Quote from: dxoigmn on November 25, 2004, 08:07 AM
Quote from: Soul Taker on November 25, 2004, 06:49 AM
>:(
Doesn't look like CallByName would work for what I want.
Guess I'm going to have to skip this and find some complicated way to do it, thanks.
Well what is it you're really trying to accomplish? Perhaps it can be done in way to use CallByName?
The only time I've used CallByName was to call control properties. Unless it can be used for user-defined functions, it won't be useful to me.
I'm working on a workaround now anyway. Sadly, it won't be as effective as just buffering a bunch of function calls into a string array and then quickly calling them like I wanted to, but it should do pretty much what I intended.