B Byak@ Active Member Licensed User Mar 30, 2010 #1 how can i fast compare two arrays?arrays have one and big(300000) langth. i'm use Code: Copy diff=false for i=0 to arraylen(arr1())-1 if arr1(i)<>arr2(i) then diff=true exit end if next
how can i fast compare two arrays?arrays have one and big(300000) langth. i'm use Code: Copy diff=false for i=0 to arraylen(arr1())-1 if arr1(i)<>arr2(i) then diff=true exit end if next
N nick2210 Member Mar 30, 2010 #2 array.count Hi diff=false if arr1.count<>arr2.count then diff =true Will this do?
B Byak@ Active Member Licensed User Apr 1, 2010 #3 Byak@ said: arrays have one and big(300000) length. Click to expand... arrays have same count, i want compare elements. i'm found a fast way (for arrays of bytes only) Code: Copy bitwise.new2(1252) if strcompare(bitwise.bytestostring(arr1(),0,arraylen(arr1())),bitwise.bytestostring(arr2(),0,arraylen(arr2())))<>0 then diff=true this code do at 30ms for arrays with 300000 elements same same
Byak@ said: arrays have one and big(300000) length. Click to expand... arrays have same count, i want compare elements. i'm found a fast way (for arrays of bytes only) Code: Copy bitwise.new2(1252) if strcompare(bitwise.bytestostring(arr1(),0,arraylen(arr1())),bitwise.bytestostring(arr2(),0,arraylen(arr2())))<>0 then diff=true this code do at 30ms for arrays with 300000 elements same same
N nick2210 Member Apr 1, 2010 #4 pardon Hi "Бяка". I want to appoligize for trying to teach you as I had failed to notice your veteran's status at first.:sign0161:
pardon Hi "Бяка". I want to appoligize for trying to teach you as I had failed to notice your veteran's status at first.:sign0161:
N nick2210 Member Apr 2, 2010 #6 no sarcasm No sarcasm at all. I also hope that your line of code above will help me in better understanding the whole bitwise stuff. P.S. Failed to send you a message via ICQ.:sign0089:
no sarcasm No sarcasm at all. I also hope that your line of code above will help me in better understanding the whole bitwise stuff. P.S. Failed to send you a message via ICQ.:sign0089:
B Byak@ Active Member Licensed User Apr 3, 2010 #7 hmm...try again,maybe it is problem of my messenger...or send me PM with your ICQ =)
N nick2210 Member Apr 3, 2010 #8 icq Hi. My icq number is 598513815. Would you send me a "hi"? I thought (from your nick) you were russian so I hope for better understanding. So far I have no acquantance who is good in programming.
icq Hi. My icq number is 598513815. Would you send me a "hi"? I thought (from your nick) you were russian so I hope for better understanding. So far I have no acquantance who is good in programming.