Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro and evaluate() fire a error with CR on Literals
Message
 
To
29/12/2004 15:49:57
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00973008
Message ID:
00973137
Views:
19
Hi Fabio,

>I try another example:
>
>CLEAR
>ON ERROR ?? MESSAGE()
>
>? "Expected : 6    Observed VFP8 : 6 VFP9 : Error"
>? EVALUATE("printLenString([3+5"+CHR(13)+"+2])")
>
>? "Expected : 6    Observed VFP8 and VFP9 : Error"
>? EVALUATE("printLenString([3+5"+CHR(10)+"+2])")
>
>ON ERROR
>
>PROCEDURE printLenString(s)
>RETURN LEN(s)
I think, you are still evaluating a multi-line string. A single line string with a CHR(13) or CHR(10), using your example could be:
? "Expected : 6    Observed VFP9 : 6"
? EVALUATE("printLenString([3+5]+CHR(13)+[+2])")

? "Expected : 6    Observed VFP9 : 6"
? EVALUATE("printLenString([3+5]+CHR(10)+[+2])")
For me the rule of the Thumb is, would the string be a valid VFP commandline. See the difference:

Your string: (not a valid vfp commandline)
printLenString([3+5
+2])
My string: (a valid vfp commandline)
printLenString([3+5]+CHR(10)+[+2])
Regards,
Frank Camp
Previous
Reply
Map
View

Click here to load this message in the networking platform