array manipulations

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
dhobbs
Posts: 24
Joined: Tue Dec 15, 2009 6:25 pm

array manipulations

Post by dhobbs » Mon Mar 01, 2010 3:24 pm

I'm trying to become familiar with arrays.
One thing I need to do is display the contents of the array. When I use "combine" it appears to change the array into a string. So, for example if I write: put 12 into elemArray[C], and then write: combine elemArray using CR and comma, I my elemArray is not an array any longer.

I would like to display my array without changing it into a different form. Can I do this? Is there a copy command that duplicates my array variable into another variable?

Thanks,

--Doug

Klaus
Posts: 13864
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: array manipulations

Post by Klaus » Mon Mar 01, 2010 3:32 pm

Hi Doug,

maybe
...
put my_array1 into copy_of_my_array1
...
will work for you? 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9738
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: array manipulations

Post by dunbarx » Tue Mar 02, 2010 8:41 pm

Klaus is correct. But what he may not have said strongly enough is that when you combine an array, you change the array to an ordinary variable. The array is toast. So he suggests that you work with a copy, that you an do with as you like, and still keep the original.

You can always "split" the data you have "combined", though, if you think that is better. This will give you back your array.

Craig Newman

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”