Re: A New error msg, for me: % Variable is undefined: <UNDEFINED> [message #48171] |
Wed, 29 March 2006 19:50 |
Wayne Landsman
Messages: 117 Registered: January 1997
|
Senior Member |
|
|
> But it shouldn't have produced this "Variable is undefined:
> <UNDEFINED>", because _nothing_ should produce this error. If an
> undefined variable is invoked, the error returns the name of the
> variable. If a $v is defined, then Expr($v) should be defined also,
> except in specific cases that have their own errors (e.g. non-existent
> structure tags, pointer stuff).
I agree.
It has been years since I have seen a similar error message, but the last
time it happened it was due to a bug in IDL that was fixed in the subsequent
release.
What IDL version are you using?
I suggest finding the simplest code that reproduces the message, and then
filing a bug report with RSI.
--Wayne
|
|
|
|
Re: A New error msg, for me: % Variable is undefined: <UNDEFINED> [message #48173 is a reply to message #48172] |
Wed, 29 March 2006 16:05  |
MarioIncandenza
Messages: 231 Registered: February 2005
|
Senior Member |
|
|
David,
Thanks for the reply.
Yeah, the variables are all there. Inside the function, I didn't use
KEYWORD_SET, I just check for N_ELEMENTS, and indeed I had made a
mistake when changing a variable name.
But it shouldn't have produced this "Variable is undefined:
<UNDEFINED>", because _nothing_ should produce this error. If an
undefined variable is invoked, the error returns the name of the
variable. If a $v is defined, then Expr($v) should be defined also,
except in specific cases that have their own errors (e.g. non-existent
structure tags, pointer stuff).
And whatever was the case, why didn't I get any traceback?
When you code by trial and error, as I do, errors that don't include
traceback can exact a cost in pulled hair.
Cheers,
--Edward H.
|
|
|
Re: A New error msg, for me: % Variable is undefined: <UNDEFINED> [message #48176 is a reply to message #48173] |
Wed, 29 March 2006 14:27  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Ed Hyer writes:
> Hello brilliant people,
>
> This is "found debugging": either you've had this happen, or you
> haven't.
>
> Here is the exerpt from the command line:
>
> IDL> lc=hs05_g12_glccv20_flambe
> IDL> gf=hs05_g12.fflag_a
> IDL> gs=hs05_g12.fsize_a
> IDL> test=flambe_lc2totalflux(lc,goesflag=gf,goessize=gs)
> % Variable is undefined: <UNDEFINED>.
> % Execution halted at: $MAIN$
>
> Here is the declaration line of the function, which compiles without
> error:
>
> function flambe_lc2totalflux,hslc,goesflag=goesflag,goessize=goessize ,
> $ isgoes=isgoes,ismodis=ismodis
>
> This is something stupid, but without any traceback, I am pretty much
> at sea.
I think it means that a variable is, uh, well, undefined. :-)
I would try this just before the call to the function:
HELP, lc, gf, gs
If the variables are defined there, then I suspect there
is a problem inside the function with a misuse of Keyword_Set,
or something similar.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|