DECLARE GLOBAL / EXTERN

Bruce Easton bruce at stn.com
Fri Jul 27 11:14:04 PDT 2007


Kenneth Brody wrote Friday, July 27, 2007 1:42 PM:
[..]
> 
> Note that it is perfectly acceptable to have DECLARE EXTERN in the
> main processing, and DECLARE GLOBAL in the CALLed table, as long as
> you don't use the variable until you call the table that actually
> defines it with the DECLARE GLOBAL.  I do this all the time.
>

Now he tells us :):)  You probably did say this before, but I missed 
this ability completely.

[..]

> 
> In more complex library scenarios, I often have an "init" table with
> all of the DECLARE GLOBALs needed by the library, in addition to any
> required initializations, which gets called prior to using any of
> the library routines themselves.
> 

And that's probably why.  I'm in a habit of declaring long vars at 
the top of the main table with edit, len, etc.

But it seems to me that if your main use of a particular 
declared variable (especially if it is only set and changed) is in 
a called table, and, like you say, you don't need to reference it 
prior to the call, then it would be more useful to have the full 
declaration in the called table as well for easy reference.  
In either case, declaring with EXTERN begs the programmer to put 
some kind of comment about the field where I try mention the length, 
edit, purpose.


Bruce

Bruce Easton
STN, Inc. 


More information about the Filepro-list mailing list