LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array into cluster

If I have a cluster of 30 elements and an array of 10 elements which I want to insert as individual elements into the cluster starting at position 15, I think I can say the I want to put the elements into the middle of the cluster. 🙂
0 Kudos
Message 11 of 21
(1,263 Views)
This is still not enough information. Is every cluster element a string?
0 Kudos
Message 12 of 21
(1,262 Views)
No, otherwise I would use an array.
0 Kudos
Message 13 of 21
(1,259 Views)
Well, as others have already said, you just need to index out the elements and then bundle them into the correct place...
 
e.g. as follows:
 
 
 


Message Edited by altenbach on 05-13-2008 11:59 AM
0 Kudos
Message 14 of 21
(1,249 Views)
Or with a for loop as I said.
Thanks
0 Kudos
Message 15 of 21
(1,241 Views)
Overall, I recommend to rethink your data structures. For example if your middle 10 string elements always go together, you should maybe use a cluster that has only 21 elements, where one of the elements is a string array of size 10, for example.
 
Also name your elements so you can use "bundle by name" for better self-documantation and cleaner code.
0 Kudos
Message 16 of 21
(1,236 Views)
Don't think I can do that. Thanks.
0 Kudos
Message 17 of 21
(1,234 Views)


exo wrote:
Or with a for loop as I said.

Why use a FOR loop if you can do it in a single atomic operation?
 
Loops don't work well with clusters. A loop is doable but pretty pointless and complicated..
0 Kudos
Message 18 of 21
(1,233 Views)
I'll take your word for it. Thanks again.
0 Kudos
Message 19 of 21
(1,230 Views)
Heres a FOR loop solution.... but why????? 😄 (I would not recommend this)
 


Message Edited by altenbach on 05-13-2008 12:23 PM
0 Kudos
Message 20 of 21
(1,222 Views)