Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro and evaluate() fire a error with CR on Literals
Message
 
À
29/12/2004 15:49:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00973008
Message ID:
00973137
Vues:
18
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform