Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exicuting setup code supplied by a memo field
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00053165
Message ID:
00053300
Views:
20
>>I am trying to use a combo box to set up my report selections. This box gets its information from a Reports table ( prety name, file name, setup code, index order etc.). I need to be able to run the code stored in the setup code memo field from the valid clause of the combo box. Any suggestions.
>>
>I would suggest to keep this code in methods in a custom Report object, and in the table keep just method names.

One commonly used trick is to use VFP source code (or fragments of code) stored in the memo field and use macro substitution to execute them. Some programmers will put an opcode at the beginning of each line in the memo file (for example, FNAME::MyFile, Index:::ZipOrder) and use the opcode to drive their own customized "code fragment processor". (i.e., strip off the opcode and use the opcode to tell you how the rest of the line is supposed to be used). It's kind of like a poor man's compiler. This has the advantage of being scaleable and also making the lines of code in your memo field position independent.
Previous
Reply
Map
View

Click here to load this message in the networking platform