Arrays: append, delete At, delete Last, Count, Sort

Mark Brownell gizmotron at earthlink.net
Wed Sep 10 15:47:03 EDT 2003


Subject:

Subject: [was]Re: I know this is newbie... it's about Arrays.

On Monday, September 8, 2003, at 09:07  PM, Mark Brownell wrote:

> appendArray(myArray, "12 Monkeys") -- adds "12 Monkeys" to end of 
> myArray
> appendArray(myArray, 1234) -- adds 1234 to end of myArray
> deleteArray(myArray, 2) -- deletes all existence of 2 and reduces all 
> the rest by one
> sortArray(myArray) -- sorts numerically and/or alphabetically myArray
>
> addAtArray(myArray[3], "10 Monkeys")
> -- use this instead of ( put "10 Monkeys" into myArray[3] )
> -- just in case myArray only contained 2
> -- this is to keep track of the number of items in an each array.
>
> Now that I know how to save arrays into a customProperties file I can 
> add this function to my FrogBreath.rev example.
>
> Seems like an nice addition. If I get this done I will post it here.

Well I did add these array features to my FrogBreath.rev example.

put: go url "http://www.gizmotron.org/frogbreath.rev" into the message 
window with an active internet connection.

Arrays: append, delete At, delete Last, Count, Sort
==============================
1.) Use "PNLP (XML) to theArray" or "frogBreath to theArray" first to 
create an array to work with.

2.) Use the different buttons to test array manipulations.
==============================

I was not able create functions that did this by passing the array as a 
parameter in the function. All these button click handlers require that 
the keys to the array be sequential and numerical. Like 1, 2, 3, etc...

Enjoy,

Mark




More information about the use-livecode mailing list