Jump to content

Adding Two arrays


BatMan22
 Share

Recommended Posts

So I am trying to add two arrays that I've pulled data from via the _Excel_RangeRead function and simply add a space in between them. And Concatenate apparently isn't what I'm looking for and neither is insert or add...

All I am trying to do is add two arrays in this fashion

$aArrayTarget[5] = ["0", "1", "2", "3", "4"]
$aArraySource[5] = ["A", "B", "C", "D", "E"]

So something like...

$aArraySum = $aArrayTarget & "blah" & $aArraySource

that would yield

$aArraySum= [0blahA, 1blahB, 2blahC, 3blahD, 4blahE]

in the sum array.

What I DONT want is 0, 1, 2, 3, 4, A, B, C, D, E which I've managed to recreate like 5 different ways now. :(

 

Thanks guys :)

 

 

 

Link to comment
Share on other sites

Like this?

#include <Array.au3>

global $aArrayTarget[5] = ["0", "1", "2", "3", "4"]
global $aArraySource[5] = ["A", "B", "C", "D", "E"]


for $a=0 to ubound($aArraySource)-1
    $aArrayTarget[$a]=$aArrayTarget[$a]&"Blah"&$aArraySource[$a]
Next
_ArrayDisplay($aArrayTarget)

 

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...