So there's indeed a side effect on negative indicies of the array_check() routine in qbx.cpp, which is switched on/off by using CHECKING:ON/OFF:
inline ptrszint array_check(uptrszint index,uptrszint limit){
//nb. forces signed index into an unsigned variable for quicker comparison
if (index<limit) return index;
error(9); return 0;
}
but the problem here arises as you're not consistent in your programming, you assign values in CHECKING:OFF mode, so array_check() can't twist any indicies, but you then recall the values (PRINT) in CHECKING:ON mode, so array_check() will twist the negative indicies, hence you essencially recall values from different indicies than those which you assigned the values too, simply comment out the CHECKING:ON, so the PRINT can run in CHECKING:OFF mode too, and it will work:
wins(-2) = -2
wins(-1) = -1
wins(0) = 0
wins(1) = 1
'$CHECKING:ON
The question now is, how to tackle this issue the best way. As it is obviously (in a bigger program) hard to keep track, that every array accesses are done in the same mode (CHECKING:ON/OFF) and this is probably also not always desireable, it should be done to be independend of the use of the array_check() routine, which is switched on/off by CHECKING.
1.) Waive to negative indicies (IMHO something weird anyways)
2.) Waive to the use of CHECKING:OFF completely when using arrays
3.) Revoke my changes regarding CHECKING:OFF in arrays (seems the easiest, it's only deleting a coulple lines)
4.) Find another way, which can deal with negative indicies as well as random CHECKING modes
I know what I'm doing with my personal copy of QB64, --- I'll do nothing ---, as I'd never ever in my weirdest dreams get the idea to use negative array indicies at all, hence the problem doesn't exist for me. Negative array indicies are as unusual and useless to me like OBPTION BASE 1 and OPTION _EXPLICIT, but as it is a matter for the entire QB64 user base, I'll listen to your thoughts, however revoking my changes seems to be the easiest and most safe way, as every experimenting could introduce new unexpected array behavior.