Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Line of code that works yet shouldn't
Message
From
05/07/2007 06:44:49
 
 
To
05/07/2007 06:24:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01237329
Message ID:
01237868
Views:
15
>As others have already said this is because syntax highlighting parses # compiler parser.
>
>You can use it the other way around and comment a multiline command with a single * in front of the first line only...
>
>
* select fields;
>from table;
>into cursor result
>
>
>In VFP9 all lines are highlighted green, in VFP7 only the first but still this is interpreted as a comment only.
>
>I assume the compiler first will remove any ;+whitespace+crlf and handle only unconcatenated lines while the syntax highlighter parses lines as they are.
>
>Bye, Olaf.

Hi Olaf

Yes I realised that the editor syntax colouring is at odds with the compiler interpretation. I've since made it unambiguous. As I've said, I was going by MapBasic SQL (the more recent I've used) where such a line would indeed have been illegal (you can't have * PLUS a list of other fields) and forgetting that it was OK in VFP.

As for the single * commenting out multi lines of code, I've been bitten by that in the past, and the editor AND the compiler don't give a hint that the subsequent lines of code are dismissed. Good that VFP 9 would show you that.

BTW, by "green" I assume you refer to the default syntax colours, as not everyone wil have the same. :-)

Bye

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform