Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this a bug in CREATE CURSOR command?
Message
From
19/12/2004 10:58:08
 
 
To
19/12/2004 09:14:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00970382
Message ID:
00970394
Views:
12
>Hi, everyone
>
>Yesterday I was converting a MS SQL script into a VFP Create Cursor command. The script creates tables and I changed it to create VFP cursors. One of the lines in the original script was
>
>CREATE TABLE MyTable (MyField DECIMAL(10,2)).
>
>Surprise, surprise. The above command, modified as CREATE CURSOR MyCursor (MyField DECIMAL(10,2)) does not error, but instead creates a DATE datatype field. Not to mention it took me half of a day to find what the problem is (INSERTS failed constantly and I had thousands of fields in the script).
>
>Further investigations shown that
>
>
>CREATE CURSOR MyCursor (MyField DOLGHIN(10,2))
>
>
>does not error, but instead creates a DATE field in the cursor.
>
>Is this a bug or a known issue?
>
>
>Thank you.

It depends from as the grammar of the language is defined:
if the grammar says that only the first character belongs to the grammar,
then all the characters succeeded are an implicit comment.

This would have to be the VFP design.
In fact this is worth also for CursorSchema of a CA object.

The same thing is worth in very many other cases, and is similar to:
IF.T. &&HERE A IMPLICIT COMMENT IT IS NOT ALLOWED
ELSE  THIS IS A IMPLICIT COMMENT
ENDIF THIS IS A IMPLICIT COMMENT
DO CASE  THIS IS A IMPLICIT COMMENT
ENDCASE THIS IS A IMPLICIT COMMENT
Where the construction falls is on CAST(),
where this rule is not worth,
and must write the type of data exactly.

Therefore the grammar is not defined very well,
and all it can be justified with compatibility problems.

Of course I are not agree with this choice,
because this renders the grammar full of variant rules,
contradictions and special cases.

This induce many developers to change language;
a bad luck why VFP is conceptually much valid one.

Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform