Re: PV-Wave Insists My Label is Undefined [message #71482] |
Wed, 23 June 2010 12:02 |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
On Jun 23, 2:06 pm, Solargus <solar...@gmail.com> wrote:
> I'm at a complete loss as to why my labels are coming up as undefined
> in the following code. Can anyone help?
>
> print, 'Enter the time of interest:'
> print, ' '
>
> retry: print, 'Enter the 4-digit year: '
> read, beginyr
> beginyr=fix(beginyr)
> beginyr=strtrim(beginyr, 2)
>
> print, 'Enter the month (i.e. 11 for Nov): '
> read, beginmo
> beginmo=fix(beginmo)
> beginmo=strtrim(beginmo, 2)
>
> print, 'Enter the day: '
> read, beginday
> beginday=fix(beginday)
> beginday=strtrim(beginday, 2)
>
> print, 'Enter the UTC hour: '
> read, beginhr
> beginhr=fix(beginhr)
> beginhr=strtrim(beginhr, 2)
>
> idx = where((time.year eq beginyr) and (time.month eq beginmo) and $
> (time.day eq beginday) and (time.hour eq beginhr))
> idx=fix(idx)
> case 1 of
> (idx eq -1): begin
> read, 'The input you provided failed to produce a time index. $
> (0) Try again (1) Exit ', response
> response=fix(response)
> if (response eq 0) then begin
> goto, retry
> endif else goto, exit
> endcase
>
> Print, 'The index for the time you entered is: '
> print, idx
>
> exit: cd, '/data1/Ken-rpm/GOES_TRENDING_ANALYSIS/trending_files'
> retall
> end
I don't know what you mean by your "labels coming up undefined", but I
did some issues. The time structure is not defined in your code
snippet. Ok, so I defined it as
IDL> time = {year:2010,month:6,day:23,hour:12}.
Your case statement is not complete. Add an endcase to end the (idx
eq -1): begin.
If the 'time' I manually entered matched the 'time' structure, there
is no case statement to handle it. Add an ELSE: in your case
statement to handle that.
Then it'll at least compile. I'm not sure what you're doing with it.
Regards,
Brian
|
|
|