reading data into structs (was (no subject)) [message #4832] |
Mon, 07 August 1995 00:00 |
rep2857
Messages: 28 Registered: December 1994
|
Junior Member |
|
|
In article <404p8u$v44@seralph9.essex.ac.uk>,
Pearson J E <jepear@essex.ac.uk> wrote:
> A small problem I am having in pvwave.
>
> How do you read in values from data files into structs?
>
> Any help would be appreciated.
Cc'd to jepear@essex.ac.uk
You'll need to create a temporary variable to hold the data being read
and then store that temporary data into the struct. A "feature" in
the way WAVE handles structure tags is that they cannot get assigned
directly from a function call keyword (also true for IDL).
Something along the lines of this ought to work:
tdata = intarr(2, /nozero)
data = intarr(2, 400, /nozero)
openr, lun, file, /get_lun
for i = 0, 399 do begin
readu, lun, tdata
data(*,i) = tdata
endfor
Mike Schienle Hughes Santa Barbara Research Center
Home: mgs@seldon.terminus.com Work: rep2857@sbsun0010.sbrc.hac.com
Contract Employee - Will visualize data for large amounts of money
|
|
|