OK, the new version is up.
Here's the test code:
// === BEGIN Array Tests ===
SquirrelObject array = SquirrelVM::CreateArray(10);
int i;
for (i = 0; i < 10; i++) array.SetValue(i,i);
array.ArrayAppend(123); // int
array.ArrayAppend(true); // bool (must use bool and not SQBool (SQBool is treated as INT by compiler).
array.ArrayAppend(false); // bool (must use bool and not SQBool (SQBool is treated as INT by compiler).
array.ArrayAppend(123.456f); // float
array.ArrayAppend(_T("string")); // string
array.ArrayAppend(456); // Will be popped and thrown away (below).
// Pop 3 items from array:
array.ArrayPop(SQFalse); // Don't retrieve the popped value (int:123).
SquirrelObject so1 = array.ArrayPop(); // Retrieve the popped value.
const char * val1 = so1.ToString(); // Get string.
float val2 = array.ArrayPop().ToFloat(); // Pop and get float.
printf("[Popped values] Val1: %s, Val2: %f\n",val1,val2);
int startIndex = array.Len();
array.ArrayExtend(10); // Implemented as: ArrayResize(Len()+amount).
for (i = startIndex; i < array.Len(); i++) array.SetValue(i,i*10);
root.SetValue("array",array);
SquirrelObject arrayr = array.Clone(); // Get a copy as opposed to another reference.
arrayr.ArrayReverse();
root.SetValue("arrayr",arrayr);
// === END Array Tests ===
SquirrelObject define_printArray = SquirrelVM::CompileBuffer(" function printArray(name,array) { print(name+\".len() = \"+array.len()); foreach(i, v in array) if (v != null) { if (typeof v == \"bool\") v = v ? \"true\" : \"false\"; print(\"[\"+i+\"]: \"+v); } } ");
SquirrelVM::RunScript(define_printArray);
SquirrelObject test = SquirrelVM::CompileBuffer(" printArray(\"array\",array); printArray(\"arrayr\",arrayr); ");
SquirrelVM::RunScript(test);
John