Weird syntax error with lookups using keywords for cursor names

Kenneth Brody kenbrody at bestweb.net
Thu Apr 5 15:02:34 PDT 2007


Quoting Tyler (Thu, 5 Apr 2007 14:38:02 -0700):

> I'm hoping someone on the filepro mailing list might be able to
> explain this to me...is there a rational explanation for it being this
> way?  I've put up the file I'm discussing at
> https://www.kinotox.net/prc.ToInvhead2
>
> If you look at line 104, you'll see that it's perfectly innocuous
> except for the fact that it's using a lookup that has a keyword for
> it's alias (::lookup user = users  k=40   i=A -npx:):
> ::user(166)=user(166)+"1":
>
> This causes the compiler to bomb out in a very strange way:
[...]
> None of this happens if I comment out line 104, of course.

Actually, it's the commenting out of line 106 that "fixes" the
problem.  (Try it -- keep the lookup, drop the assignment, and
do a syntax check.)

> Now, I've figured out that this is because USER is actually a keyword
> for a command...but why does it bomb out on line 5 instead of the
> lookup line or the first time I try to use the lookup cursor?  And why
> does it let me use a keyword for a lookup name at all?

Re-examine line 106:

    user(166)=user(166)+"1"

You have set up a USER command, with the (invalid) alias "(166)",
which will execute the command user(166)+"1".  A quirk in the
parser would then treat an open-paren as a reference to this
USER command.

This was fixed in 5.6.02, and should now (IIRC) give you a syntax
error on line 106.

You will, of course, still need to change the alias to something
other than "user".

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list