Hi Mark,
That's interesting. I tried some of those, and the only one I got to actually crash was when using a string array. It doesn't matter if it is or is not dimensioned, either.
PRINT "Press any key to test..."
SLEEP
IF i MOD pagemax = 0 THEN pagenum = pagenum - 1
SELECT CASE a$(1)
END SELECT
or...
PRINT "Press any key to test..."
SLEEP
IF i MOD pagemax = 0 THEN pagenum = pagenum - 1
DIM a$(1)
SELECT CASE a$(1)
END SELECT
----------------------------------------
Both examples using a string variable a$(1), in one example NO DIM and DIM in the other, crash. Just like your experiments, if I change a$(1) to just a$ or a, it properly reports division by zero, which occurs in the MOD statement for anyone just picking up on this thread.
Now it WON'T crash if you change SELECT CASE a$(1) to SELECT CASE VAL(a$(1))
So once we convert a string to a numeric value, QB64 is once again able to trap and display a division by zero error.
Also, this only seems to be happening when used in SELECT CASE. You can get rid of the SELECT CASE statement, and just put a PRINT a$(1) or put in a DO UNTIL a$(1) = "" : LOOP ... and it WON'T crash, either. So far, the only crash is with SELECT CASE.
@ COBALT: What OS are you running? One test Fell used was on a Windows XP 32-bit, and it didn't crash, but his 64-bit Win 10, which is what I'm using and I think what Mark is testing on, crashed. BTW - This isn't an IDE issue. It is only a compiled code issue. I agree with you the IDE should not be responsible for checking division by zero, especially when a variable is used as the divisor. Thanks for testing!
Pete