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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Question regarding IDLgrAxis
Next Topic: Re: One More Mac Question

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

Current Time: Sun Oct 12 17:04:36 PDT 2025

Total time taken to generate the page: 2.07848 seconds