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

Home » Public Forums » archive » Re: functions arguments
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: functions arguments [message #46379] Tue, 15 November 2005 02:29
Liberum is currently offline  Liberum
Messages: 48
Registered: September 2005
Member
Hi Timm,

That was it!

Thanks a bunch,
Sheldon
Re: functions arguments [message #46380 is a reply to message #46379] Tue, 15 November 2005 02:22 Go to previous message
Timm Weitkamp is currently offline  Timm Weitkamp
Messages: 66
Registered: August 2002
Member
Liberum wrote:
> Hi everyone,
>
> I have a function that takes several arguments and one keyword.
>
> whenever I try to use one of the arguments in a Keyword_set() function
> or Case IDL says that the variable is undefined. I am missing something
> here and I don't know what.
> ------------------------------------------------------------ ------------------------------------------------------------ ---------------
> function tool, cp, date, til, VERBOSE=verbose
>
> if keyword_set(verbose) then print, format='(%"The product selected is
> %s for %s")', cp, date
>
> CASE cp OF
> c4 : extract = "Ma"
> c8 : extract = "CT"
> ch : extract = "HGT"
> ENDCASE
> ------------------------------------------------------------ ------------------------------------------------------------ -----------------
> This variation also fails:
> **************************************************
> function tool, cp, date, til, VERBOSE=verbose
>
> CASE cp OF
> c4 : extract = "Ma"
> c8 : extract = "CT"
> ch : extract = "HGT"
> ENDCASE
> **************************************************
>
> IDL call results:
> a = tool(c4,200412,D,/verbose)
> % PRINT: Variable is undefined: CP.
>
> Appreciate any help rendered,
> Lib

In the calling sequence "a = tool(c4,200412,D,/verbose)", the
expression "c4" is a variable, and this variable is apparently not
defined. This is what causes the error.

Did you intend "c4", "c8", and "ch" to be string values? In that case,
all occurrences of the string value must be put in quotes (single or
double), both in the function call and in the CASE expression.

Hope this helps,
Timm

Timm Weitkamp, ESRF, Grenoble, France
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Question regarding IDLgrAxis
Next Topic: Re: One More Mac Question

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

Current Time: Thu Oct 09 20:02:35 PDT 2025

Total time taken to generate the page: 0.40059 seconds