[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading file into structure?



Randall Skelton wrote:
> READF, 1, data                 ;<-- this works.
> READF, 1, data.values          ;<-- why doesn't this work?

because data is passed by reference and
data.values is passed to READF by value

> READF, 1, array
> data.values = array          ; <-- dirty cheat

not a dirty cheat but one possible way to get your data into structure.
another way is to define values in your structure as a pointer

data = {basic_struct, comment: ' ', values: ptr_new(fltarr(nlev))}

and then

READF, 1, *data.values


-- 
Ivan Zimine                   |   ivan.zimine@physics.unige.ch
Dpt. of Radiology             |   (+41 22) 372 70 70
Geneva University Hospitals   |