Any response to my DECLARE question

Jeff Harrison Jeff.Harrison at Epixweb.com
Thu Apr 22 06:10:40 PDT 2004


John Esak wrote:
> 
> 
> Did anyone have a response to my question about DECLARE 
> EXTERN not giving an
> error at runtime if the variable is referenced and there is 
> no DECLARE'd
> GLOBAL partner to be found?  Shouldn't filePro complain if a 
> variable has
> not been established correctly before it is used?
> 
> To restate:
> 
> 
> Just as you can't do:
> 
>        a=xx
> 
> if xx has not been brought into existence somewhere else, why 
> should you be
> able to do:
> 
>    then: declare long_variable
>    then: a=long_variable
> 
> if there isn't a DECLARE global long_variable in the "calling" table?
> 
> John\
> 

I'm not sure I agree.  By doing the declare external you are basically
telling filePro that there is such a thing as this variable - You are just
not sure at this point how it is going to be defined.  It seems reasonable
that filepro would then reserve a pointer for this.

In your example with the regular dummy field, you have never told filepro in
advance that such an animal exists - so it is surprised and bombs when you
reverence it.  However, as you know, dummy fields can be defined on the fly
if they are not explicitly casted and an assignment is used instead.

Come to think of it, you can't do that with the long variable names - you do
need to do a declare external in order to define fields on the fly.  Perhaps
that is the reason that your example does not give an error.

Jeff Harrison
jeff.harrison at epixweb.com

Author of JHExport and JHImport - The fastest and easiest ways to generate
code for filepro exports and imports.  Demos available upon request.


More information about the Filepro-list mailing list