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

Home » Public Forums » archive » Variable undefined after while-cycle?
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
Variable undefined after while-cycle? [message #26685] Wed, 19 September 2001 04:16
Olaf Stetzer is currently offline  Olaf Stetzer
Messages: 39
Registered: September 2001
Member
Hello,

I have a strange problem which may be related to the
way IDL frees varaibles in/after subroutines. In the
following example I want to compare a value with the
one from the last while-cycle, however the Variable
to store the Value for the next cycle (Lasttime)
seems to be empty even at the end of the cycle
(at point ;;;XX). When I define the Variable Lasttime
before the while not EOF.... then the behaviour is
still the same, the comparison (Lasttime ne mstime)
is always true, even if it should not!

Thanks,

Olaf

----------------
while not EOF(lun) do begin
readf, lun, line
line=strjoin(strsplit(line,'"',/extract),/single)
Lasttime=double(values(1))
values=strsplit(line,',',/extract)
msdate=double(values(0))
mstime=double(values(1))
if (Lasttime ne mstime) then begin
print,'', Lasttime, mstime, ' Zeiten sind ungleich!'
Zeitpunkt=mstime2sqlts(msdate,mstime)
insertstr='INSERT INTO ' + table + ' VALUES ("' +
sqlts2datetimestr(Zeitpunkt) + '"'
for i=2,(n_elements(fields)-1) do insertstr=insertstr + ', ' +
values(i)
insertstr=insertstr+ ' ) ;'
;;;XX
;dbobj->ExecuteSQL,insertstr
endif else begin
print,'', Lasttime, mstime, ' Zeiten sind gleich!'
endelse
endwhile

--
Dr. Olaf Stetzer
Forschungszentrum Karlsruhe
Institut f�r Meterologie und Klimaforschung
Atmosph�rische Aerosole (IMK III) - http://imk-aida.fzk.de
Tel.: +49(0)7247-82-3249 (FAX: -4332)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: kind of bewildered
Next Topic: Re: Rotate volumes

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

Current Time: Wed Oct 08 17:40:24 PDT 2025

Total time taken to generate the page: 0.00553 seconds