Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to improve this macro?
Message
From
11/04/2007 18:00:49
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01214724
Message ID:
01214748
Views:
7
>>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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform