Jump to content
Sign in to follow this  
BlueScreen

How To Make A Copy Of An Array

Recommended Posts

BlueScreen

Guys,

How to make a copy of an array without erasing the original?

Dim $x[3]
$x[0]=0
$x[1]=1
$x[2]=2

$x=$y

Should I do it the 'Hard' way? (copy the values with a 'For' loop?)

Edited by BlueScreen

Share this post


Link to post
Share on other sites
Jos

this works ( just swap the $x=$y to $y=$x :whistle: ):

Dim $x[3]
$x[0]=0
$x[1]=1
$x[2]=2

$y=$x
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
BlueScreen

Hmmm.... Didn't though about it.

10x

:whistle:

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  

×