Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
&& within string gives error
Message
 
 
À
07/01/2002 19:49:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00601634
Message ID:
00601771
Vues:
29
JimN,

I see JimB mentioned the code example I was going to post about macro expansion, I have seen that kind of code in production apps at more then one place. Frankly I'd never use it because I think it's more clearly written as a string expression because it doesn't require runtime compilation and it's more "cross language" compatible to do it this way:
lcStr = "ABC"
? "Here is the first three letters in the alphabet " + lcStr
What I do think is the worst error here is that the syntax coloring parser is out of synch with the compiling parser. While typing this code:
test = "this is a test && of the code"
? test

the text to the right of && should be flagged as a comment in the editor instead of waiting to get a compile time error when trying to run the above code

>>With the && not I don't think there is any issue. However with the & macro expansion there very well may be code out there that expects;
>>
>>
>>lcStr = "ABC"
>>
>>? "Here is the first three letters in the alphabet &lcStr"
>>
>>
>>prints: Here is the first three letters in the alphabet ABC
>
>That's the way I see it too. I must admit that it was by accident that I found that macro expansion worked within constants, and have used it a couple of times to advantage.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform