dynamic run

Faitie

New Member
Hey PT

I was wondering if there is a way i could do this.
I have a table that contains relative paths to a lot of .p files. Now i would like to find first over that table, grab the field that contains the path. And use that to load the .p file.
using RUN table.path

Is there a way i could do this, or should i start looking for a diffrent solution?

thanks!
 
Hey thanks for the quick reply, but assuming i have input parameters for the .p files. how should i do that ?
 
Ok found it, thanks for the fast help Cringer ^^
you can use run value(table.path)(input 1, input 2, input 3).
 
It works for fixed parameters, but i did not find a solution for a variable parameters.
do you have a idea ?
 
i'll let you know if i find a solution.

The Call Object, circa 9.1 or so, lets you (in effect) build a run statement on the fly with an arbitrary combination of parameters. This technique is much more flexible than the static RUN; but also much more verbose and prone to errors. Sample:

DEF VAR h_call AS HANDLE NO-UNDO.
CREATE CALL h_call.
h_call:CALL-NAME = "my-program.p".
h_call:SET-PARAMETER(1,"ROWID","INPUT",h_some_variable). /* Repeat as required */
h_call:INVOKE().

I probably missed something here, but hopefully you get the idea.
 
I had no idea that existed. Thanks!!

I'm guessing you still need to clear up after yourself...
 
Of course you need to clean up - as always with handle-based dynamic objects that you create at run time :)

Heavy Regards, RealHeavyDude.
 
Back
Top