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
|