dc_read_free [message #5094] |
Wed, 20 September 1995 00:00 |
orbach
Messages: 9 Registered: June 1994
|
Junior Member |
|
|
I'm having trouble understading how the /resize keyword works
in the function dc_read_free in WAVE.
Say that I have a file called data.txt, which consists of two
columns and 100 rows. The first column has file names (and is
thus strings) and the second column has snapshot numbers (and
is thus integers).
I find that if I predefine a variable, say, names, as
WAVE> names = ""
and predefine another variable, say, snaps, as
WAVE> snaps = intarr(500)
and then say
WAVE> result = dc_read_free('data.txt', names, snaps, /column, $
/resize)
the result is that the string array names will resize correctly
to however many elements there are in the first column (in this
case 100), but the integer array snaps will not do so (that is,
it remains a 500-element array).
Even more strange than this, if instead I predefine snaps as
WAVE> snaps = intarr(1)
i.e. to be an array smaller than the number of columns in the
file, now neither snaps nor names will resize correctly, and
in this case, they will both remain arrays with only 1 element
in them.
Anyone get this?
|
|
|