Any response to my DECLARE question
John Esak
john at valar.com
Thu Apr 22 19:02:14 PDT 2004
> -----Original Message-----
> From: Jeff Harrison [mailto:Jeff.Harrison at Epixweb.com]
> Sent: Thursday, April 22, 2004 9:11 AM
> To: 'John Esak'; filePro mailing list
> Subject: RE: Any response to my DECLARE question
>
>
> 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.
>
No, I totally disagree with this, Jeff. You are not telling filePro that
there is some variable but you are not sure at this point how it is going to
be defined... Quite exactly the opposite. You are telling filePro with the
DECLARE EXTERN that there _is_ a variable in existence on a table that _will
be_ "calling" this table and that it (filePro) should get the length and
edit of this variable - and possibly an actual value being passed - from
that other GLOBAL variable. It is not just to throw undefined, unreferenced
variables in the table... There is NO reason to use DECLARE EXTERN in the
way you suggest... they always must refer to a partner GLOBAL variable for
edit type and value.... They can, of course, send that value back out for
other tables... if so defined... but they aren't just there because you
don't know how they are going to be used.
My point was (by showing the assignment of a two character variable that
hasn't been defined) you get an indication from filePro that there is a
problem. I made a rookie mistake the other day and had a slightly misspelled
variable listed as the EXTERN partner and I was not informed. It took the
debugger and some sleuthing to figure out a problem that filePro would
immediately already _know_ at run time. I think this is a bug not any kind
of a feature. Okay, well, maybe not a bug, but an oversight or such. I hope
it gets fixed/changed/corrected. The ability of filePro to point out runtime
errors is a fantastic time saver when debugging any program and the better
more thorough we can make it, the all around better it will work.
John
Visit The FP Room www.tinyurl.com/yuag7 24/7
More information about the Filepro-list
mailing list