Quote: "Length is in AppGameKit the HIGH index. LOW is usually 1. But, of course, element zero is there as a phantom.
"
I use 1 to the array length in my loops and leave 0 as a reserve, but I always declare the size when declaring the array.
I'm not sure why I would want an array of an undefined length when arrays can eat up so much memory.
Quote: "It's definitely not how arrays work in C++, but I digress since this is BASIC."
I guess that is my problem too sorta... I'm used to using BASIC instead of C++.
There seems to be differences in arrays depending on which language, as some start at 0 and others at 1.
This is the first time I have encountered the -1 thing in all my years, but I don't use empties, so that makes sense.
Quote: "Getting a handle on things now, thankfully!"
Me too.
This is my first time seeing the insert().
@ Jeku
Did you try the ,i ?
I am still wondering if that was a quick fix, but its not biggie if you didn't try.
Was just hoping for a result if you did try it.
Quote: "This is really going to mess me up with this project that deals so heavily with arrays and string manipulation"
You could also use 0 as a reserve and assign it a value.
Then use 1 to length for the loops calling the insert() and you should be okay.
This should avoid the -1 slot, as long as you assign the 0 element with a value before using the insert().
It's always been easier for me to use arrays starting at 1 to whatever because I count things with the first thing being 1.
So, like to have that 0 slot sitting there unused for the data.
I do use it on occasion for boolean flags (int arrays), or titles etc (str arrays), or other things that require a variable.
I just call the xelement[0] specifically, and not included in a data manipulation loop.
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1