comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: A New error msg, for me: % Variable is undefined: <UNDEFINED>
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: A New error msg, for me: % Variable is undefined: <UNDEFINED> [message #48171] Wed, 29 March 2006 19:50
Wayne Landsman is currently offline  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 #48172 is a reply to message #48171] Wed, 29 March 2006 16:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ed Hyer writes:

> When you code by trial and error, as I do, errors that don't include
> traceback can exact a cost in pulled hair.

When you code by trial and error, pulled hair is the *least*
of your problems. :-)

If it is tracebacks that you want, maybe you should
stick a few ERROR_MESSAGE calls into your programs:

http://www.dfanning.com/programs/error_message.pro

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
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 Go to previous message
MarioIncandenza is currently offline  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 Go to previous message
David Fanning is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: some geometry questions.
Next Topic: map_set, !map, !x, !p.position (and behind this curtain, !x.*)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 08:51:06 PDT 2025

Total time taken to generate the page: 0.00451 seconds