Yep, it just spins for two seconds, and then crashes. No error message.
Pete
$CHECKING:OFF
$CONSOLE:ONLY
_DEST _CONSOLE
PRINT 1 MOD 0
What OS version again? (If it's been mentioned above I missed it, sorry)
Yep 1.3. To be even more specific...
V 1.3 [Revision] Stable from git: 96937f0
Pete
Yep 1.3. To be even more specific...
V 1.3 [Revision] Stable from git: 96937f0
Pete
Hi Steve,
That's another division by zero, when the pagemax variable didn't get passed as 10 because of the typo in the sub call. The thing is, you can take that line out, which I agree would be the first division by zero encounter, and leave the MOD line in; it will still crash. So, that's a bit of a red herring. The crash is only eliminated when the SELECT CASE is removed, and that's weird, because that part of the program flow isn't even reached yet. Try this. Remove those 4 lines and it won't crash, it will just properly trap the division by zero error.
Hi Fell,
I tried it in version 1.2 just now, and got the same crash results. Like I mentioned, If I take the integer division out, and leave the MOD, it still crashes. Now here's an interesting one. I took both MOD and the integer division out, and substituted in PRINT 0 / 0. It actually completed, and printed: NAN D
Now if I substitute in PRINT 0 \ 0 (integer division) it crashes again, with reporting a division by zero error. It's just really odd that it's the presence of the not yet engaged...
SELECT CASE a$(j)
CASE "<!--ID-->"
a$(j) = "1"
END SELECT
... is what makes it crash. When I take those four lines out, it prevents the crash, and simply reports the division by zero error.
I guess we chalk this one up as some rare oddity that hopefully won't ever affect a program without a coding error causing it.
Thanks for having a look guys,
Pete
Pete
Hi Mark, please read my above edited reply. I posted back to Steve and Fell the same time you posted. As you will see, those other variables are just orphaned from what used to be 500 lines of code in a sub. I whittled the problem down so it could be tested. In other words, I could define and populate all of those arrays, and it wouldn't make any difference in the crash occurrence. The crash problem is independent of those variables. This was just the smallest amount of code I could whittle down to and still preserve the crash.
Pete
OK it doesn't crash with a$() not dim. It was OPTION _EXPLICIT that wouldn't let it go until DIM'd, with that commented out, it works with just typo fix.