Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution error (maximum statement length?)
Message
 
To
05/10/1999 04:58:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00272599
Message ID:
00272651
Views:
40
>Hello All,
>
>I've got a problem with the macro (&) substitution. I've got a table with error messages that call some program functions. These error messages are executed with a macro like:
>
>lcMacro = table.errorcommand
>lctext = &lcMacro
>messagebox(lctext)
>
>Where table.errorcommand is a memo field.
>
>The problem is that with long error messages (>255 chars) this will not work anymore. I've seen a reference in the manual that sais "The string in the macro command cannot exceed the maximum statement length. BUT there is no actual number on how long the maximum statement length is.
>
>So my question is: Does anyone know what the max. statement length is and also some suggestions on how to solve this problem would be much appriciated.
>
>TIA,
>
>Wim Dieke

Had a similar problem recently and was offered a simple solution here on the UT. Create a temp file and push the command out to the temp file. Then run the temp file as a program. If you are using VFP 6, StrToFile() will make this easier, if not, let me know as I have a VFP 5.0 program that emulates these commands. Using your statements, it would be something like this:

cFileName = SYS(3) + '.PRG'
StrToFile(table.errorcommand, cFileName)
DO &cFileName
ERASE &cFileName
Oct 31 = Dec 25
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform