DECLARE GLOBAL / EXTERN
Shane Gray
shane at satsof.com.au
Mon Jul 30 17:10:30 PDT 2007
Nancy said:
>
> I can say this logic works well. In a programming setup where I was
> using a large set of library processes that would be called from
> multiple filepro files, I found I could manage it best if I
> put all the
> declare globals in a called library table.
>
> Then each file that does a call does the call to declare the global
> variables first, then does the library calls required.
>
> Then I only had the variable definitions in one process table
> and could
> change edits or lengths without updating 20+ tables.
>
> I usually did this step in @once to insure that it was done before
> anything else and it was always done.
>
> I also found that I like to keep the DECLARE's in the table
> that needs
> them. So the call table would have the list of DECLARE
> EXTERN's that it
> needed at the top and not a cut&paste list that included a
> lot of other
> stuff.
>
The only problem with this approach is that you cannot see the variables in
the F6/D/L list in your current program. We have also run into problems
with chained programs (from before call was available) and declare globals
where because the programs are completely independent the variables would
need to be declared global in both, or in auto processing.
We therefore use "declare extern" for called routine parameters in both the
calling program and the called routine. Where a specific variable
length/edit type is required within a called routine, a local variable of
the required length/edit is used.
Shane.
More information about the Filepro-list
mailing list