[BASIC] Bug make system freeze when source code is "big"
François Vanzeveren (2221) 241 posts |
Hello As the application I am writing is growing, the need to split it in different “modules” became insistent. As i thought this was caused by the split in different files, I came back to the situation where the !RunImage contains the whole source code… to discover, horrified, that this did not help… It is as if the application has become too big for BASIC to handle error “properly”! NOTE: due to the specifity of the application, I run it in BASIC VI (for 64bits floating number) Please, I desperately need help! Thank you very much. François |
Steve Drain (222) 1620 posts |
I think it is extremely unlikely that the program is too big. If you attempt to load it, or its libraries, into a wimp slot that is too small you will get an error before anything dangerous happens. Your description is very brief. When you say the system freezes, is that completely, or do Alt_Break or Ctrl_Break work? Are you doing any indirected memory accesses that could overwrite other parts of the system? Is there any assembler? It occurs to me that you could check how your error handling routine works. If you don’t have ON ERROR OFF you could get into a loop, but that should respond to Alt-Break. Any more detail, such as the version of BASIC VI, would make help easier, but I’m afraid it is something in the program, rather than a limitation of BASIC. |
Rick Murray (539) 13840 posts |
As Steve says – it is unlikely to be BASIC. The more probable cause is something went askew when the program was split up. The first thing to try:
If so, comment out the code (a quick’n’dirty way if it is big is to wrap it in If Alt-Break works so you can abort your program, try using: If your program does stiff the machine (so nothing permits access to the OS) then your best bet is to write a routine to pop up a Wimp_ReportError box; then just call this with a different letter of the alphabet at checkpoints within your program (so you can click past A, B, C, D, and the machine freezes before it gets to E). Something like this:
T’was simpler on my A5000, I could just TRACE TO “serial:$.meh” and watch the output on an old VT110 terminal hooked up to the serial port. ;-) |
Martin Avison (27) 1494 posts |
What do you call ‘big’? I regularly run a Basic program with about 30,000 lines, with about 30 libraries. It does error from time to time(!), and I have not had lockups as you describe. But I do use Reporter for debugging! |
François Vanzeveren (2221) 241 posts |
Hi I thank you all warmly for your answers. I will keep you inform. I might drop the code somewhere on the net for download if i continue to be stuck. Cheers François |
François Vanzeveren (2221) 241 posts |
Hello Thank you for the alt-break tip… it indeed helped a lot and solved my problem of rebooting… |