>I have been looking through some code and have found the following:
>
>m.lookup = [ text text text ]
>
>When I tried this, it seems that it has made it a text variable.
>
>I have looked on MSDN library for some documentation on this, since I have never seen this, and could not find anything.
>
>Could anyone point me to documentation for this or explain when and why you would use the above?
>
VFP offers the option of encapsulating strings in three ways - using single quotes - ' text text text ', double quotes - " text text text " or matched pairs of square brackets - [ text text text ]
The reason you'd choose one over the other is ease of use - if you wanted to place the phrase
Ed's new book "How to confuse FoxPro" in a single string, and you didn't have the option of using square braces, you'd have to split up the string. You can do:
cMyString = [
Ed's new book "How to confuse FoxPro"]
or
cMyString = "
Ed's new book " + '
"How to confuse FoxPro"'
to avoid having the parser misinterpret the string. It's a matter of flexibility, and has been a standard for Fox and other dBASE-derived languages for as long as I can remember.