Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamically build code into database
Message
 
To
27/07/1999 19:01:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00246923
Message ID:
00247012
Views:
28
>Hi. I'm new at VFP6 and want to do something clever but don't have the foggiest clue how to accomplish this. I have a report driver screen that lists a number of reports and allows the user to select the appropriate report. (So far so good...) Once the user highlights the report title I want to display options on the lower portion of the screen. These are report specific options and I would like to put the code (that builds the objects - like a date range, or a picklist) into a database and extract the code from there. I figure that way I will only have to code one screen and whenever I add a new report, I will only need to add the code into that database. I know it must be possible to do since VFP is all databases anyways but can anyone tell me how to do this?? (I'm slow so explain in fairly good detail.)
>
Sandi,

You have two options:

1) Build your code and evaluate it at runtime using macros (&) or the EVAL() function. This only works if you are doing one expression or command at a time.

2) Even better if you add VS patch SP3: You can use COMPILE to compile code on the fly. If your code is in a database (Memo field maybe), you must first write it out to a file (using SET ALTE TO or FCREATE/FPUTS) and COMPILE. Then you can use the DO to execute it.

Costas
Previous
Reply
Map
View

Click here to load this message in the networking platform