Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro and evaluate() fire a error with CR on Literals
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00973008
Message ID:
00973091
Views:
19
>Are you sure you aren't thinking of EXECSCRIPT()? EVALUATE() is only supposed to operate on a single expression. Macro Substitution isn't supposed to work with more than one line, either.

Hi Garrett,

Of course!
But VFPT don't trap a multiline CR or NL, they have trapped a innoffensive literal CR or NL,
it is a character, not a command line separator.
The bug it is still present on VFP9.

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])")

? "Expexted : Error Observed VFP8 and VFP9 : Cut the code"
? EVALUATE("printLenString([A])"+CHR(13)+"+printLenString([A])")

? "Expexted : Error Observed VFP8 and VFP9 : Cut the code"
? EVALUATE("printLenString([A])"+CHR(10)+"+printLenString([A])")

? "Expexted : Error Observed VFP8 and VFP9 : Cut the code"
? EVALUATE("printLenString([A])"+CHR(0)+"+printLenString([A])")

ON ERROR 

PROCEDURE printLenString(s)
RETURN LEN(s)
Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform