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

Home » Public Forums » archive » Q: Indexing arrays with variable # dimensions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Q: Indexing arrays with variable # dimensions [message #4810] Thu, 10 August 1995 00:00
Tim Purschke is currently offline  Tim Purschke
Messages: 2
Registered: August 1995
Junior Member
i want to index an array with a number of dimensions that is not known
until runtime.
Creation of array:
a = intarr(dimsize^dimnumber)
dimidx = intarr(dimnumber) + dimsize
a = reform(a, dimidx)

Now i want to set an element of a to a certain value.
eg. a(3,2,4,3) = 7 (for dimnumber = 4)

how can i store this index list to make the asignment work?
i've tried idx=[3,2,4,3] & a(idx) =7 but this of course does not work.


Can anyone help?


Thanks in advance,

Tim


--
Tim Purschke, Wasserburg 2, 63500 Seligenstadt, Germany
Tel: +49-(0)6182-28952
Email: purschke@igd.fhg.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Undocumented function to extract routine names?
Next Topic: test, please ignore

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

Current Time: Wed Oct 08 13:44:17 PDT 2025

Total time taken to generate the page: 0.00449 seconds