Info Posted June 20, 2010 Share Posted June 20, 2010 I want $a to be like: $a[0] = '1' $a[1] = '2' $a[2] = '3' $a[3] = '4' I tried this: Func _ArrayCombine($a1, $a2) Dim $a[UBound($a1) + UBound($a2)] For $i = 0 To UBound($a) - 1 If $i < UBound($a1) Then $a[$i] = $a1[$i] Else $a[$i] = $a2[UBound($a2) - $i] EndIf Next Return $a EndFunc ;==>_ArrayCombine Dim $a1[2] $a1[0] = "1" $a1[1] = "2" Dim $a2[2] $a2[0] = "3" $a2[1] = "4" $a = _ArrayCombine($a1, $a2) For $i = 0 To UBound($a) - 1 MsgBox(0, '', $a[$i]) Next But it doesnt work well. Link to comment Share on other sites More sharing options...
Mat Posted June 20, 2010 Share Posted June 20, 2010 (edited) _ArrayConcatenate It's just a fancy way of saying _ArrayCombine. Edit: With a slightly different syntax: #include<Array.au3> Local $a1[2] $a1[0] = "1" $a1[1] = "2" Local $a2[2] $a2[0] = "3" $a2[1] = "4" _ArrayConcatenate($a1, $a2) _ArrayDisplay($a1) Edited June 20, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
Info Posted June 20, 2010 Author Share Posted June 20, 2010 thanks! 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