Adding 1 to an array

David Bovill david at openpartnership.net
Sat Jun 23 16:28:55 EDT 2007


Why does this function not work:

function index_CreateArray someIndex, someNumber
>     split someIndex by CR and tab
>     add someNumber to someIndex
>     combine someIndex by CR and tab
>     return someIndex
> end index_CreateArray
>

But I get an error with:

put index_CreateArray("Hello",1)
>


>From the docs:

If a number is added to an arrayContainer, the number is added to each
> element. If an array is added to an arrayContainer, both arrays must have
> the same number of elements and the same dimension, and each element in the
> array is added to the corresponding element of the arrayContainer.
>
> If the container or an element of the arrayContainer is empty, the add
> command treats its contents as zero.
>



More information about the use-livecode mailing list