EEL doesn't have "arrays" as such, but memory positions which allow you to use indexed variables as simple one-dimensional numeric arrays.
You really need to set the memory start position of each, and space these positions apart far enough for the maximum number of indexes you'll use in each. If you want to use strings, you have to point real strings to indexes in longhand first.
It's quite a "low-level" language, but it's good because it's fast in REAPER.
- If you want to know the number of elements, you have to count them as they are added.
- If you want to reverse the order, you need to step through and copy to a second array, starting end to front, and then copy-back if necessary.
- If you want to delete the first and last element then you either set them to a value you know represents "null", or copy to a new array less he first nd last and then copy-back, again, if necessary.
- If you want to concatenate multiple arrays then you need to do it "manually", copying each to a new array and keeping tabs on their lengths, positions in the new array, etc, as you do.
I get the feeling that this is not what you want to hear, but these are the limitations of EEL indexing. You might be better off loading up a prerelease of v5 and learning
Lua as it is a higher-level embedded scripting language with tables and functions to query and manipulate them.
Alternatively, look at the source code in my
Item Marker Tool (see sig) and
BWF Metadata (bext and iXML) reader (get last beta 03, good examples here) to see the hoops you have to jump throughwhile using EEL indexing. Look in the
init function at the end of the code for index memory initialisations like:
Code:
selected_mkr = 4000; // array pointers.
swap_selected_mkr = 6000;
selected_mr_list = 8000;
...to give you the vaariable names to look for.
Hope this helps, have fun!
>