insert into range of array

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

insert into range of array

Post by kwinkler » Sat Dec 18, 2010 5:02 am

I'm guessing this cannot be done in LiveCode (since I can find no reference), but is it possible to simply insert a value into a range of an array, such as-

put 10 into myArray[4-6]
or
put 10 into myArray[4 to 6] ?


It seems that a repeat loop is the only way to accomplish this.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: insert into range of array

Post by Mark » Mon Jan 10, 2011 1:45 am

kwinkler,

Yes, you will need a repeat loop. Even with large data sets, repeat for each will probably be faster than anything else in this case.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply