>Hi Guys,
>
>I have a VFP6 App which needs to use macro substitution to update fields in a table. The app works great running from the command line (i.e. running a PRG that runs a form). However, when I create and run an EXE, VFP just skips right over the REPLACE statement! Even stranger, I use a similar technique in another part of the same app with no problems. The code is like:
>
>TVar="T" + ALLTRIM(STR(kSet))
>REPLACE &TVar WITH "AO" + cOrder + cLine
>
>in this case, I have verified that kSet='S51' which is the name of the field I want to update. I have verified that the statements are executing, but NOTHING shows up in the file. I have tried this on several machines with the same result.
>
>Any ideas?
>
>Desperately,
>
>-Arne
If kSet = 'S51' I would have expected a Data Type mismatch on the first line.
Assuming that you meant TVar = "S51" your code should have worked. It is probably better to change the syntax to
REPLACE (TVar) WITH "AO" + cOrder + cLine
but that doesn't affect your problem.
Any chance that you are at EOF() when you try the REPLACE statement?
Any chance that TVar actually contains a form of "alias.field" pointing to a different workarea and that you are at EOF() in the current workarea?
Any chance that you have some error trapping going on which causes the statements to be bypassed?
Good Luck.........Rich