comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » how to get an array of variable length arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: how to get an array of variable length arrays [message #3251 is a reply to message #3152] Mon, 28 November 1994 01:43 Go to previous message
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
greec@essex.ac.uk wrote:
: Does anyone know how you can create an array of
variable length : arrays?.

: e.g in C you could do it like this:

: float a[10],b[5],c[14];
: float *arrays[3];

: arrays[0]=a; arrays[1]=b; arrays[2]=c;

: Thanks in advance for any help you can give.

: Chris

: greec@essex.ac.uk


The only thing I can think of would be to use a structure: e.g. for you
example

a = fltarr(10)
b = fltarr(5)
c = fltarr(14)
arrays = {f1:a, f2:b, f3:c}

You can then access the fields numerically by using the form:
val = arrays.(n)(m)

But you can't then replace the f3 field with a 6 element array, you would
have to make a new structure.

--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@xun8.sr.bham.ac.uk | University of Birmingham | -- \/` |
| "If all else fails--read the instructions!" | |
+----------------------------------------------------------- --+---------+
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: connecting pts with arrowed lines
Next Topic: Re: Q: square plots in IDL - thanks

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 16 01:43:43 PDT 2025

Total time taken to generate the page: 0.96079 seconds