>I have an app in VFP6 that is updated via email. I have about 25 tables to update and rather that have 25 seperate programs or one big program with 25 case statments, I set up a table to hold the names of the native tables, the names of the imported tables, the index expressions, the relation expressions and the update expressions.
>
>I capture these in variables and then execute the command from a macro: ie
>lcUpdate_exp=ie_tables.update_exp
>&lcUpdate (where the code in the update_exp memo field would be something like:
>REPLACE mytable.ord_qty with importtable.ord_qty... etc)
>
>Here is the problem: some of the code (but not all) produces errors -
>"syntax error" or "illegal command" However, when I take the code and put it into a program, it compliles and runs without error. When I put the code back into the memo field, I get an error.
>
>Why? Anybody run into this?
>
Macro-execution is limited to a singleline of executable code; things get squirrelly in memos.
If you're running VFP6, why not extract the memo field content to a file using STRTOFILE(), compile the resulting file using the COMP:ILE command inside the runtime, and run that? This capability came in with the SP3 update.