Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd bug with semi-colon
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00508472
Message ID:
00508488
Views:
30
>>>The following Create Cursor statment does not execute (in some circumstances...at least), is due, I think to the semi-colon at the end of the first line. However, since the asterisk is supposed to comment out the first line, I'm thinking this maybe is a bug?
>>>
>>>* CREATE TABLE temp2 FREE(tmpPrjID c(13),;
>>> CREATE CURSOR temp2 (tmpPrjID c(13),;
>>> tmpPrjName c(30),;
>>> tmpAppName c(40),;
>>> tmpCommit N(10,2),;
>>> tmpExpend N(10,2),;
>>> tmpBalance N(10,2))
>>
>>Yep, and this is fairly well known. Part of the problem is that the syntax coloring fails to note that the lines following the first are considered by the compiler as continuations. Since the first line is a comment, the remainder are as well.
>
>It was noted in VFUG Newsletter quite recently...

It's fairly easy to see what's happening. You have two different things going on. Real time syntax coloring and compile time syntaxing. Basically what happens is this: When you enter the "*" or "&&" character(s) the syntax coloring for the characters that follow is turned on until you press the enter key. When then happens unless the comment characters are entered again, is that the "syntax colorer" goes back to trapping individual keystrokes. By contrast, the compiler would probably load a line of code, checking the ending character to see if additional lines follow. If it encounters the semi-colon, it then will repeat the process until the entire line is loaded, then it compiles.

If there's a bug here, it's with the way the syntax colorer is working, not the compiler. How easy it would be to fix, is another question entirely, one that I'm not familar enough with the VFP internals to be able to answer.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform