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

Re: taming the shrew, a.k.a. structure



I can't really see why you are getting an error. I copy-pasted your code
onto the command line and it works just fine. I got rid of a few spaces
though :-)

month_struct = {month_struct, name: ptr_new(), day: $
ptr_new(), temp_c:ptr_new()}
station = {station, number:0L, month:{month_struct}}
po_basin = replicate(station, 10)
po_basin.month.name = ptr_new(strarr(2190))

Cheers,
Pavel

BTW, I'd suggest using /Allocate keyword when making those pointers.
This way you can simply say
*(po_basin.month.name)[i] = strarr(2190). Also, looks to me that all
elements of po_basin in your example will have the same strarr(2190) as
their Month.Name. Is this what you wanted? If you want different
contents, you will have to specify pointer contents individually for
every element of the array.