Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compiler does not catch this syntax error, bug?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00901990
Message ID:
00902067
Views:
31
I am sorry guys who replied to my initial message. The sample bug code wasn't true representative of the my actual code. Here is a better one and see if you can compile it with a syntax error:
*bug.prg 
LPARAMETERS m.lpcAlias,m.lpnid
		SELECT &lpcAlias..filenum ;
			&lpcAlias..a, ;
			&lpcAlias..b ;
			&lpcAlias..c, ;
			&lpcAlias..d, ;
			FROM  &lpcAlias ;
			ON &lpcAlias..id = m.lpnid;
			INTO CURSOR curTemp NOFILTER 
Now save the code as a prg and compile it however you like. I do not get a syntax error.

Dawa

>Dawa,
>
>If I type this into a MODI COMM window:
>
>
select a, ;
>       b, ;
>       c ;
>       d, ;
>  from mydb!table1 ;
>  into cursor curjjj
>
>
>And then:
>
>1) save the prg I get the error: "Command contains unrecognized phrase/keyword" because I have compile before save checked.
>
>2) select Program, then Compile from the menu, I get the error
>
>3) highlight the command in the editor and do a rightclick, execute selection, I get the error.
>
>This is in VFP6 I can't test in 8 at the moment.
>
>>Hi, all,
>>
>>I just noticed this. If I have a SQL stement as follows:
>>
>>
>>select a, ;
>> b, ;
>> c ;
>> d, ;
>> from mydb!table1 ;
>> into cursor curjjj
>>
>>
>>When I save the prg, it does not tell me that there is a syntax error. But when this line gets excuted I get
>>"Command contains unrecognized phrase/keyword." message. I am using VFP 7. Is this a bug in the compiler? If so, is it fixed in VFP 8? It would be more productive if VFP told me that there is a comma missing or there is an extra comma, then I can fix it right on the spot. Instead I have to debug, get an error, stop the debugger, find my prg, find the line, then look for the syntax that caused the error. It's time consuming when I have alot of fields, in the above like statements, to go through the process. On the other hand, once discovered, it is easily fixed in the code.
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform