Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to improve this macro?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01214724
Message ID:
01214768
Views:
8
>>>I have a code that uses a macro, here is an example:
>>>
>>>
>>>cPageMsgExpr = filetostr("MyTextFile.CFG")
>>>=SendPageMessage( cPageNumber, "Order #" + alltrim(str(MYTABLE.ORDER_NO)), 	&cPageMsgExpr. )
>>>
>>>
>>>The issue is with the variable cPageMsgExpr. An example of content of MyTextFile.cfg is as following:
>>>
>>>"trim(MYFIELD1) + ', ' + trim(MYFIELD2) + ', ' + trim(MYFIELD3)"
>>>
>>>The problem is that often times when I make changes of the content of MyTextFile.cfg (which I do using Notepad), the code breaks and I get error message "function missing )"
>>>
>>>I can't figure out what changes from change to change that causes this error.
>>>
>>>What should I do to this text file or to my macro to avoid this error message?
>>>
>>>Thank you for any suggestions.
>>
>>Make sure to remove CRLF from the file. Though I'm not certain what does SendPageMessage do and how does it work.
>
>I thought about this CRLF too but wasn't sure how to remove it in Notepad or Edit (which I also use to edit this file). I guess I will have to run it through a VFP function that removes the CHR(13) and CHR(10).
>
>Thank you for your suggestion.

And may be chr(9) as well. Put your cursor at the end of the line and press delete. Anyway, strtran should work too and it may be better.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform