Reserved Words (2) 
Author Message
 Reserved Words (2)

Oops. Look before you leap.

The problem with "final" was that I had a field called
"final" and array called "final". If you attempt to GET an
array element then you get a message "No exported method:
DISPLAY"

The problem is nothing to do with "final". It fails just as
willingly if you have a field called "fred" and an array
called "fred".

But my comment about problems with "field.dbf" still
applies.

Roderick


Orkney Islands, Scotland, UK



Mon, 30 Apr 2001 03:00:00 GMT  
 Reserved Words (2)
Hi!
Roderick McLeod wrote (with editing):
Quote:
> The problem with "final" was that I had a field called
> "final" and array called "final". If you attempt to GET an
> array element then you get a message "No exported method:
> DISPLAY"

Replace 'get final[x]' with 'get m->final[x]', where x is
the element number you GET.
I'd also recommend not to miss field names with
variable names, or always use 'field->final' when you
mention field rather than a var, and 'm->final' in opposite case.
BTW, reserved words list is in Clipper .ng file.
--
Regards, Vladimir (http://i.am/kzm)


Tue, 01 May 2001 03:00:00 GMT  
 Reserved Words (2)

Quote:

>Oops. Look before you leap.

>The problem with "final" was that I had a field called
>"final" and array called "final". If you attempt to GET an
>array element then you get a message "No exported method:
>DISPLAY"

>The problem is nothing to do with "final". It fails just as
>willingly if you have a field called "fred" and an array
>called "fred".

>But my comment about problems with "field.dbf" still
>applies.

One of the things that I liked about going up through the versions was
that it exposed stupid things I did in my code. Generally, these were
very obscure problems. Hang in there.

There is a header file that was provided with 5.x which you can place
at the top of a piece of S'87. When you compile with this header, it
exposes many reserved situations. Take a look at RESERVED.CH.

--

        Oasis WWW  http://www.iag.net/~philb/
         FTP Site  ftp://ftp.iag.net/pub/clipper
      Clipper FAQ  http://www.iag.net/~philb/clipper.html

Each of us define ourselves each day by the choices that we make.
                       Dr. Norman Vincent Peale



Tue, 01 May 2001 03:00:00 GMT  
 Reserved Words (2)

McLeod) wrote (possibly edited):

Quote:
>The problem with "final" was that I had a field called
>"final" and array called "final". If you attempt to GET an
>array element then you get a message "No exported method:
>DISPLAY"

>The problem is nothing to do with "final". It fails just as
>willingly if you have a field called "fred" and an array
>called "fred".

>But my comment about problems with "field.dbf" still
>applies.

Roderick

See earlier post about FIELD.DBF.  I can't get a problem with what you
describe above either.  I created a local variable called ASSET and
read the contents of a record into it.  One of the fields in the open
table (FIELD.DBF) was also called ASSET.  I used this code


        read save

No problem - again 5.2e/DBFNTX.  The get object looked quite normal.

What does your failing code look like?

Don

A tortoise was mugged by a gang of snails.  When the police asked what
happened, he replied "Sorry officer, it all happened too quickly.



Tue, 01 May 2001 03:00:00 GMT  
 Reserved Words (2)
Except that M->VarName will only be right if it's a PUBLIC or PRIVATE
variable; the M-> alias won't see locals/statics.  To avoind confusion, I
use the /v compile parameter (all unaliased references are memvars - the
default is fields) and make sure I always alias fields.

So, in the context of this thread it's possible to have THREE different type
of references with the same name:
1) Field_->VarName
2) VarName (local/static)
3) M->VarName (public/private)

Quote:

>Hi!
>Roderick McLeod wrote (with editing):
>> The problem with "final" was that I had a field called
>> "final" and array called "final". If you attempt to GET an
>> array element then you get a message "No exported method:
>> DISPLAY"
>Replace 'get final[x]' with 'get m->final[x]', where x is
>the element number you GET.
>I'd also recommend not to miss field names with
>variable names, or always use 'field->final' when you
>mention field rather than a var, and 'm->final' in opposite case.
>BTW, reserved words list is in Clipper .ng file.
>--
>Regards, Vladimir (http://i.am/kzm)



Tue, 01 May 2001 03:00:00 GMT  
 Reserved Words (2)

[SNIP the problem with "final"]

Quote:
>But my comment about problems with "field.dbf" still
>applies.

 A file named "field.dbf" is likely to have its alias conflict with
statements like
  variable := field->NameOfTheField".
 See the Norton Guides, under Language/Operators.
 In the Norton Guides you will find also a list of reserved words
under Tables/Reserved Words. "Field" isn't among them, though.
 The Norton Guides are shipped with Clipper 5 and installed under \NG,
IIRC. Search for a file named "NG.exe" (DOS TSR program).

Warning: to e-mail me, first remove the SPAMBLOCK.



Tue, 01 May 2001 03:00:00 GMT  
 Reserved Words (2)
Many thanks for all responses.

I have now sorted out the "field" problem. It appears that
field->fred means the same as currentfile->fred. So field
can be used as the converse to m-> to refer to a field in
the current file.

My problem stemmed from the fact that field.dbf was NOT the
current file. So when I referred to field->price I thought I
was referring to a field called price in another file, but
the reference was being actually made to the current file.

Roderick


Orkney Islands, Scotland, UK



Tue, 01 May 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Problem with reserved words in column names.

2. Reserved words in JCL

3. PB 3.5 Reserved Words List?

4. Obtaining a list of Clarion Reserved Words

5. Reserved word ?

6. CW4 - Reserved Words

7. xbase to clarion with reserved word as xbase variable

8. Reserved words

9. 359 Reserved Words and No Syntax

10. Reserved Words and Functions

11. VO2 - BEWARE Reserved words!

12. Erlang reserved word

 

 
Powered by phpBB® Forum Software