View Full Version : Building proc names from strings then executing them
I'm trying to build proc names from strings, and then have them execute. Here's an simple example...
string $strn = "Last";
$proc = ("show"+$strn+"Hidden");
Is this allowed? If it is, the syntax is beyond me. Any help would be apprieated.
10-09-2006, 10:13 AM
If you put an "eval" around your proc, and your proc actually exists, then it should run it. If you use the eval, you need to ensure that your proc is in the global, and not local.
global proc foobar()
// Make a string with your proc name
string $myProc = "foobar()";
You could probably write whole procedures dynamically that way, though I can't say I've ever had a use for that.
10-09-2006, 03:54 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.