Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing a program with parameters stored in table
Message
From
27/02/2006 12:07:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01099518
Message ID:
01099528
Views:
7
>I have a routine which looks in a table and executes a program with its parameters.
>
>Therefore in my program I do the following:
>
>
>SELECT vwmprograms
>SEEK vwmmatch.actlinkno
>lcprogram = RTRIM(vwmprograms.program)
>lcparams = RTRIM(vwmprograms.params)
>DO &lcprogram WITH &lcparams
>
>
>The program runs but it fails because it cannot find one of the parameters. The problem is I think is to do with how it gets the parameters. For example some are hardcoded and some it has to find from another table. The parameters for this particular program stored in the field are:
>
>vwmevents.mainkey, vwmevents.udf1, "C1"
>
>Even though vwmevents table is open I dont think it can calculate the value of table fields.
>
>Can anybody help me please?
SELECT vwmprograms
SEEK vwmmatch.actlinkno
lcprogram = [DO ]+RTRIM(vwmprograms.program)+[ WITH ]+RTRIM(vwmprograms.params)
&lcprogram
*** OR
EXECSCRIPT(lcprogram)
** but for EXECSCRIPT all variables you used in that script and comes from somwhere else
** must be declare as PRIVATE or PUBLIC
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform