array creation and duplication

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am

array creation and duplication

Post by kwinkler » Fri Nov 26, 2010 6:03 am

Is there a simple way to create an array of 50 floating point numbers, and then duplicate it?

Such as-

make myArray[50] --create an array of 50 elements

duplicate myArray myArray2, myArray3, myArray4 -- make three copies of myArray

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: array creation and duplication

Post by Klaus » Fri Nov 26, 2010 10:39 am

Hi kwinkler,

Code: Select all

...
repeat with i = 1 to 50
  put WHATEVER into myArray[i]
end repeat
put myArray into myArray2
put myArray into myArray3
put myArray into myArray4
...
Of course you need to replace WHATEVER with values of your choice! :)

Best

Klaus

kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am

Re: array creation and duplication

Post by kwinkler » Fri Nov 26, 2010 3:04 pm

Thanks Klaus,

I suspected it would be something like that. Since I have dozens of arrays, I was hoping to save some space.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: array creation and duplication

Post by Klaus » Fri Nov 26, 2010 3:29 pm

Hi kwinkler,

don't shoot the messenger! 8)


Best from germany

Klaus

Post Reply