Triedge 12 Posted April 17, 2015 (edited) 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 April 17, 2015 by Triedge Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted April 19, 2015 (edited) 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 April 19, 2015 by Angelmelody 1 Triedge reacted to this Quote Share this post Link to post Share on other sites
0 Alayne 99 Posted April 17, 2015 use copyarray command: *copyarray <destination array>[<first value>],<source array>[<first value>],<amount of data to copy>; Quote Share this post Link to post Share on other sites
0 Alayne 99 Posted April 19, 2015 (edited) 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 April 19, 2015 by Alayne Quote Share this post Link to post Share on other sites
0 Triedge 12 Posted April 19, 2015 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 Quote Share this post Link to post Share on other sites
0 Triedge 12 Posted April 27, 2015 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? Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted April 27, 2015 (edited) 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 April 27, 2015 by Angelmelody Quote Share this post Link to post Share on other sites
0 Triedge 12 Posted April 27, 2015 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 1 Angelmelody reacted to this Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted April 27, 2015 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* setarray .@test [getarraysize(.@test)],6,7,8; Quote Share this post Link to post Share on other sites
0 Triedge 12 Posted April 27, 2015 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* setarray .@test [getarraysize(.@test)],6,7,8; Not worry Quote Share this post Link to post Share on other sites
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 TriedgeShare this post
Link to post
Share on other sites