ddeerr Posted October 21, 2006 Share Posted October 21, 2006 Hi, All in the subject, for me just 2 simple one dimension array will be helpful. Link to comment Share on other sites More sharing options...
ddeerr Posted October 21, 2006 Author Share Posted October 21, 2006 Hi,All in the subject, for me just 2 simple one dimension array will be helpful.there is slowness on my internet connexion sorry i click two time :'| Link to comment Share on other sites More sharing options...
ddeerr Posted October 21, 2006 Author Share Posted October 21, 2006 maybe i can make an array add on the first array with each value of the second i'll beginning this Link to comment Share on other sites More sharing options...
Developers Jos Posted October 21, 2006 Developers Share Posted October 21, 2006 maybe i can make an array add on the first array with each value of the second i'll beginning this Maybe post what you already have?Adding 2 arrays should be pretty easy to do... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ddeerr Posted October 21, 2006 Author Share Posted October 21, 2006 Maybe post what you already have? Adding 2 arrays should be pretty easy to do... Here is the wanted code section : ; this getting is for getting floders thru regedit without knowing were the path beginning $tempHistoArray = recupereClefs($a) ; this function return a 1 dimension array with random total size $histoArrayS = $tempHistoArray ControlSend($wh, "", 1, "{RIGHT}") $aTemp = ControlGetText($wh, "", 3) $aTemp = StringTrimLeft($aTemp, $cNomRepRegistre) ; i get a string representing a regedit path If $aTemp = $a Or StringInStr($aTemp, $a, 1) <> 0 Then ; $a is the first path i get in my programm beginning ( 600 lines :\ ) ControlSend($wh, "", 1, "{RIGHT}") $aTemp = ControlGetText($wh, "", 3) $aTemp = StringTrimLeft($aTemp, $cNomRepRegistre) If $aTemp <> $a And StringInStr($aTemp, $a, 1) <> 0 Then $tempHistoArray = recupereClefs($tempa) ; here i need to merge datas from $tempsHistoArray with $histoArrayS EndIf EndIf Link to comment Share on other sites More sharing options...
Developers Jos Posted October 21, 2006 Developers Share Posted October 21, 2006 (edited) example on adding 2 arrays: #include<array.au3> Dim $array1[5] = [1, 2, 3, 4, 5] Dim $array2[5] = [6, 7, 8, 9, 10] ; add Array2 to Array1 ReDim $array1[UBound($array1) + UBound($array2) ] For $x = 0 To UBound($array2) - 1 $array1[UBound($array1) - UBound($array2) + $x] = $array2[$x] Next _ArrayDisplay($array1, "test") Edited October 21, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ddeerr Posted October 21, 2006 Author Share Posted October 21, 2006 example on adding 2 arrays: #include<array.au3> Dim $array1[5] = [1, 2, 3, 4, 5] Dim $array2[5] = [6, 7, 8, 9, 10] ; add Array2 to Array1 ReDim $array1[UBound($array1) + UBound($array2) ] For $x = 0 To UBound($array2) - 1 $array1[UBound($array1) - UBound($array2) + $x] = $array2[$x] Next _ArrayDisplay($array1, "test")oÝ÷ Ûú®¢×Æ'hm¶§Ú+x8¦¶h¶nëbv)¶¬jëh×6 #include<array.au3> Dim $array1[5] = [1, 2, 3, 4, 5] Dim $array2[5] = [6, 7, 8, 9, 10] ; add Array2 to Array1 For $x = 0 To UBound($array2) - 1 _ArrayAdd($array1, $array2[$x]) Next _ArrayDisplay($array1, "test") I was asking for time performance in code execution, maybe your one is much faster ? Link to comment Share on other sites More sharing options...
Developers Jos Posted October 21, 2006 Developers Share Posted October 21, 2006 tx i don't think to reDim to do that but i do it like this : #include<array.au3> Dim $array1[5] = [1, 2, 3, 4, 5] Dim $array2[5] = [6, 7, 8, 9, 10] ; add Array2 to Array1 For $x = 0 To UBound($array2) - 1 _ArrayAdd($array1, $array2[$x]) Next _ArrayDisplay($array1, "test") I was asking for time performance in code execution, maybe your one is much faster ?Both ways will work. _ArrayAdd() will do a redim each time you add a record so depending on the sizes of the arrays, there could be a performance difference. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ddeerr Posted October 21, 2006 Author Share Posted October 21, 2006 Both ways will work._ArrayAdd() will do a redim each time you add a record so depending on the sizes of the arrays, there could be a performance difference.so i take your method tx Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now