Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does this work?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00419138
Message ID:
00419219
Vues:
27
I meant a SINGLE constant. Imagine - you need to build query conditions in runtime and user typed all these characters. You make following:
MyConditions = MyConditions + ' AND [' + UserInput + ']'
...
SELECT ...
WHERE &MyConditions

Above will not work when UserInput contains all ', " and []. Need to use special string functions to split it apart as you mentioned. Why so complex? Why not just make it As I use now for SQL Server:
MyConditions = MyConditions + " AND '" + STRTRAN(UserInput,"'","''") + "'"
Above is MUCH more easy and I wery wondered why VFP don;t have such feature. :(

>>Why not make this by the same way as in other languages?
>> For example, in SQL Server I can use following:
>> MyString = 'Ed''s new book "How to confuse FoxPro"'
>>
>> In VFP I cannot make string constant that contains all ', " and [] characters :(
>
You can,
>use
lcMyString = [a string with ', " and ] + " [] is possible in VFP"
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform