Jump to content

Z3R0

Members
  • Content Count

    21
  • Joined

  • Last visited

  • Days Won

    2

File Comments posted by Z3R0


  1. Couldn't find a place to add bug report from here... so here it goes...

    array_push skips 0 values, where as setarray() does not

    I tested with the following script

     

    prontera,154,170,4    script    TEST    98,{
        
        setarray(.@one, 0, 1, 2, 3);
    
        dispbottom(getarraysize(.@one)); // 4
    
        for(.@i = 0; .@i < getarraysize(.@one); .@i++) {
            dispbottom(.@one[.@i]); // Displays 0,1,2,3
            array_push(.@two, .@i); // Pushes 0,1,2,3 to array .@two
        }
    
        dispbottom(getarraysize(.@two)); // 3
    
        for(.@i = 0; .@i < getarraysize(.@two); .@i++) {
            dispbottom(.@two[.@i]); // Displays 1,2,3 // Skips 0
        }
    
    }


     


  2. I would like to see an array_diff(.@array, .@array2)....

    something like...

    @array1[0] = 1, 2, 3;

    @array2[0] = 1, 2, 3, 4, 5, 6, 7, 8, 9;

    array_diff(@array1, @array2) = [ ]

    array_diff(@array2, @array1) = [ 4, 5, 6, 7, 8 ]

     

    First Array contains all items you WANT with any/all items from Second Array.... so in the first example with 1,2,3 it only checks against 1,2,3 existing in [1,2,3,4,5,6,7,8]

    Where as in the second example it checks [ 1,2,3,4,5,6,7,8 ] for any or all occurrences of [1,2,3] and returns the ones that don't match.. [4,5,6,7,8 ]

     

     

×
×
  • Create New...

Important Information

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