Jump to content
  • 0

How to merge multiple arrays into a single array?


Question

Posted (edited)

Hi Team,

How do we merge arrays and use them as a single array?

Example:

        setarray .attr1[0],4700,4701,4702,4703,4704,4705,4706,4707,4708,4709;
        setarray .attr2[0],4730,4731,4732,4733,4734,4735,4736,4737,4738,4739;
        setarray .attr3[0],4740,4741,4742,4743,4744,4745,4746,4747,4748,4749;
        setarray .attr4[0],4710,4711,4712,4713,4714,4715,4716,4717,4718,4719;
        setarray .attr5[0],4720,4721,4722,4723,4724,4725,4726,4727,4728,4729;
        setarray .attr6[0],4750,4751,4752,4753,4754,4755,4756,4757,4758,4759;

I want to use them as 

       setarray .combinedArray[0], attr1, attr2, attr3, attr4, attr5, attr6;

This way I can only modify a specific attribute if necessary without affecting the entire list of array, as the other .attr arrays are used in other functions.

 

Thank you.

Edited by mawjustin
Removed spacing.

4 answers to this question

Recommended Posts

  • 2
Posted
setarray .combinedArray[getarraysize(.combinedArray)], .attr1, getarraysize(.attr1);
setarray .combinedArray[getarraysize(.combinedArray)], .attr2, getarraysize(.attr2);
setarray .combinedArray[getarraysize(.combinedArray)], .attr3, getarraysize(.attr3);
setarray .combinedArray[getarraysize(.combinedArray)], .attr4, getarraysize(.attr4);
setarray .combinedArray[getarraysize(.combinedArray)], .attr5, getarraysize(.attr5);
setarray .combinedArray[getarraysize(.combinedArray)], .attr6, getarraysize(.attr6);

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...