Jump to content
Sign in to follow this  
Kiti

arrays

Recommended Posts

Kiti

Share this post


Link to post
Share on other sites
PsaltyDS

Use Ubound() to get the size of the arrays, Global/Local to create the new 2D array, then one For/Next loop nested inside the another to copy the data from the two 1D arrays into the new 2D array. Take a shot at it and post your code if you need more help.

;)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Kiti

My mind tells me to write this:

#include<array.au3>


Global $array1[5] = ["A","B","C","D","E"]
Global $array2[5] = [1,2,3,4,5]

$s = UBound($array1)

global $array3[$s][2]

for $i = 0 to $s
$array3[$i][1] = $array1[$i]
$array3[$i][2] = $array2[$i]
next


_arraydisplay($array3)

...but (of course) it's not right ;))

Any ideea about what can be wrong?

Edit: I've got it, it has to be:

for $i = 0 to $s -1
$array3[$i][0] = $array1[$i]
$array3[$i][1] = $array2[$i]
next

Thank you a lot for your help!!!

Happy New Year! :evil:

Edited by Kiti

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×