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

Home » Public Forums » archive » what am I doing wrong?
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: what am I doing wrong? [message #13036 is a reply to message #3602] Mon, 05 October 1998 00:00 Go to previous messageGo to previous message
Bruce Bowler is currently offline  Bruce Bowler
Messages: 128
Registered: September 1998
Senior Member
a couple of things... It is a top level script but there are no
continuation lines that I can see... (true, my parser is *quite*
different than IDL's :-)

second, what happens depends on how I run it, which I find quite strange
but then again, I'm a relative newbie at IDL...

I've made some changes, while trying to figure things out. Here is the
new script in it's entirety... (note I realize some of this [especially
the case statement] aren't the best way to do things but like I said,
I'm a newbie and I'm trying some things out and this is stripped down
procedure anyway...)

!path = !path + ":" + getenv("SEADAS") + "/idl_lib" +
":/disk2/seadas_data"

inputFile = "S1998228192646.L1A_HNSG"

baseDir = strmid(inputFile,0,rstrpos(inputFile,"/")+1)
baseFile = strmid(inputFile,rstrpos(inputFile,"/")+1,999)
passId = strmid(baseFile,0,rstrpos(baseFile,"."))
datePart = strmid(passId,0,8)
ozoneFile = datePart + '12_EPTOMS.OZONE'
temp = size(findfile(ozonefile))
help, temp
print, temp
defOzone = 0
CASE 1 OF
(temp[0] EQ 1): BEGIN
ozoneFile = '$SDSDATA/CLIMATOLOGY.OZONE'
defOzone = 1
print, 'using default ozone data'
END
(temp[0] NE 1): BEGIN
defOzone = 0
print, 'ozone data found'
END
ELSE: print ,'things are really wacked'
ENDCASE
print, "after case"
end

if I run it as follows...

# idl
idl> .run 6953

it works fine...

if I run it like

# idl 6953

the results are

> For basic information, enter "IDLInfo" at the IDL> prompt.
>
> % Compiled module: RSTRPOS.
> % Compiled module: REVERSE.
> TEMP LONG = Array[4]
> 1 1 7 1
> % Case statement found no matches.
> % Execution halted at: $MAIN$
>
> (temp[0] EQ 1): BEGIN
> ^
> % Syntax error.
> At: 6953, Line 15
> using default ozone data
>
> END
> ^
> % Syntax error.
> At: 6953, Line 19
>
> (temp[0] NE 1): BEGIN
> ^
> % Syntax error.
> At: 6953, Line 20
> ozone data found
>
> END
> ^
> % Syntax error.
> At: 6953, Line 23
>
> ELSE: print ,'things are really wacked'
> ^
> % Syntax error.
> At: 6953, Line 24
>
> ENDCASE
> ^
> % Syntax error.
> At: 6953, Line 25
> after case
>
> end
> ^
> % Syntax error.
> At: 6953, Line 27

unfortunately, because of the way I need to interact with some other
stuff, I really need to run it the second way. What can I do to make it
work like the first way? I don't think precompiling will work either as
I generate the file "on the fly".

Jeffrey Newmnark wrote:
>
> Hi Bruce,
>
> Is this a section of a procedure or a top level script? If it is top
> level then you need
> $ to continue lines, otherwise, IDL compiles each line by itself.
>
> cheers,
> Jeff Newmark
>
> Bruce Bowler wrote:
>
>> I have a script that does...
>>
>>> anydata, subtemp, 45.0, 40.0, -71.5, -65.0, inbounds
>>>
>>> print, subtemp
>>> print, inbounds
>>>
>>> if (inbounds eq 1) then begin
>>> openw, tarunit, 'tarfile.include', /GET_LUN
>>> printf, tarunit, l1a
>>> printf, tarunit, ozonefile
>>> printf, tarunit, metFile1
>>> printf, tarunit, metFile2
>>> printf, tarunit, 'SEAWIFS_SENSOR_CAL.TBL'
>>> close, tarunit
>>> endif
>>
>> When I run it, I get
>>
>>> S1998228192646.SST
>>> 0
>>
>> and tarfile.include is created, which since inbounds is 0, shouldn't
>> happen... can anyone explain why it's not working or some additional
>> diagnostics that might point to the cause?
>>
>> TIA,
>> Bruce
>
> ------------------------------------------------------------ ------------
> ------------------------------------------------------------ ------
>
> Dr. Jeffrey Newmark
> SOHO - EIT Team Scientist
>
> voice: (301) 286-3163 Code 682.3
> email: newmark@eitv2.nascom.nasa.gov GSFC/NASA
> newmark@gsfc.nasa.gov Greenbelt, MD 20771
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Restored Object Method Compilation
Next Topic: CENTERING TEXT

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

Current Time: Sun Apr 26 14:21:57 PDT 2026

Total time taken to generate the page: 0.87622 seconds