problems with IDL reading structures... [message #7244] |
Fri, 11 October 1996 00:00 |
alpha
Messages: 49 Registered: September 1996
|
Member |
|
|
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$i
pro test
; when I define a structure...
temp = { name, string: 'test', number: ol }
sttest=replicate(temp,10)
sttest(*).string='any_entry'
sttest(*).number=42
; and i write it to a file
openw,lun,'myfile',/get_lun
for i=1,9 do begin
printf,lun,sttest(i).string
printf,lun,sttest(i).number
endfor
close,lun
free_lun,lun
; now I want to read it
sttest=replicate(temp,10)
openr,lun,'myfile',/get_lun
for i=1,9,do begin
readf,lun,sttest(i).string
readf,lun,sttest(i).number
endfor
close,lun
free_lun,lun
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
so.. this is crashing at the point of reading
the strings back...
my work arround:
temp=sttest(i).string
readf,lun,temp
sttest(i).string=temp
this is causing no errors but randomly adds some
whitespaces at the end of the strings...
any hints for some elegant solution???
Panther
--
Panther in the Jungle __..--''``\--....___ _..,_
-BELIEVE AND DECEIVE- _.-' .-/"; ` ``<._ ``-+'~=.
http://www.ang-physik _.-' _..--.'_ \ `(^) )
.uni-kiel.de/~hendrik ((..-' (< _ ;_..__ ; `'
|
|
|