Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Warning: Square brackets as string delimiters
Message
From
12/12/2007 02:43:07
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
11/12/2007 13:38:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01274862
Message ID:
01275060
Views:
8
Cetin,

thanks for listing that. There is one aditional way to declare a string:
#define error 1

? 'An error has occurred'
? [An error has occurred]
TEXT TO lcx noshow
An error has occurred
ENDTEXT
?lcx
Update:

SET TEXT works as well with defines.

Agnes
>Recently I have seen a lot of people are using square brackets as string delimiters. That made me think most of the community isn;t aware of this fact.
>When you use square brackets and there is #define/#include in scope those strings might end with something very different than you expected. ie:
>
>
>#define error 1
>
>? 'An error has occurred'
>? [An error has occurred]
>
>Bottomline: Use single or double quotes as string delimiters unless you know what you're doing with square brackets.
>Cetin
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform