Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does this work?
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00419138
Message ID:
00419228
Views:
28
You can also use:
cMyString = "a string with ' " + CHR(34) + " [ and ]."
A string can contain ANY characters using CHR(0) through CHR(255) !
Houston.

>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"
censored.
Previous
Reply
Map
View

Click here to load this message in the networking platform