Jump to content
  • 0
Sign in to follow this  
Triedge

How add Arrays to a Array

Question

Example

 

Array = 1,2,3,4,5;

 

if(Class == Swordman)

 Add value: 6,7,8;

 

if(Baselevel > 90)

 Add value: 9,10;

 

Final Array: 1,2,3,4,5,6,7,8,9,10;

Edited by Triedge

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

you can also use setarray

 

for example

 

setarray .@test [0],1,2,3,4,5;

 

if(Class == Swordman)

setarray .@test [getarraysize(.@test)-1],6,7,8;

if(Baselevel > 90)

setarray .@test [getarraysize(.@test)-1],9,10;

Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

And for copyarray

 

setarray .@test [0],1,2,3;setarray .@test1 [0],4,5;setarray .@test2[0],6,7;if(Class == Swordman)   copyarray.@test [getarraysize(.@test)], .@test1[0], getarraysize(.@test1);//produce 1,2,3,4,5if(Baselevel > 90)   copyarray.@test [getarraysize(.@test)], .@test2[0], getarraysize(.@test2);//produce 1,2,3,6,7
Edited by Alayne

Share this post


Link to post
Share on other sites
  • 0

you can also use setarray

 

for example

 

setarray .@test [0],1,2,3,4,5;

 

if(Class == Swordman)

setarray .@test [getarraysize(.@test)-1],6,7,8;

 

if(Baselevel > 90)

setarray .@test [getarraysize(.@test)-1],9,10;

Thx very much n-n

Share this post


Link to post
Share on other sites
  • 0

i think that no neet the value -1 in the operation...

 

.@test [0]  = 1

.@test [1]  = 2

.@test [2]  = 3

.@test [3]  = 4

.@test [4]  = 5

 

with:

 

setarray .@test [getarraysize(.@test)-1],6,7,8;

 

produce:

.@test [4]  = 6

.@test [5]  = 7

.@test [6]  = 8

 

I'm right or I'm wrong?

Share this post


Link to post
Share on other sites
  • 0

i think that no neet the value -1 in the operation...

 

.@test [0]  = 1

.@test [1]  = 2

.@test [2]  = 3

.@test [3]  = 4

.@test [4]  = 5

 

with:

 

setarray .@test [getarraysize(.@test)-1],6,7,8;

 

produce:

.@test [4]  = 6

.@test [5]  = 7

.@test [6]  = 8

 

I'm right or I'm wrong?

 array element 0-4  --->getarrasize will retrun 5

so it's need to  -1

Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

 

array element 0-4  --->getarrasize will retrun 5

so it's need to  -1

 

But that does not overwrite the previous value?

 

Previous value => .@test [4]  = 5

New Value => .@test [4]  = 6

um... you are correct,I got it wrong to overwrite the previous

*wanna dig a hole and hide* :blush:

setarray .@test [getarraysize(.@test)],6,7,8;

Share this post


Link to post
Share on other sites
  • 0

 

 

array element 0-4  --->getarrasize will retrun 5

so it's need to  -1

 

But that does not overwrite the previous value?

 

Previous value => .@test [4]  = 5

New Value => .@test [4]  = 6

um... you are correct,I got it wrong to overwrite the previous

*wanna dig a hole and hide* :blush:

setarray .@test [getarraysize(.@test)],6,7,8;

Not worry ^_^

Share this post


Link to post
Share on other sites

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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.