BBC BASIC for Windows
IDE and Compiler >> Integrated Development Environment >> Disappearing BASIC http://bb4w.conforums.com/index.cgi?board=ide&action=display&num=1394378185 Disappearing BASIC
Post by KenDown on Feb 10th, 2014, 07:22am
Does anyone else have this same problem? All of a sudden - totally without warning - BB4W just disappears!
I'm in the middle of working on a program which, so far as I know, doesn't do anything illegal, doesn't use any machine code, only uses SYS calls found in the help, and suddenly the whole thing vanishes. The program doesn't just hang-up or freeze, the entire BB4W editing window disappears without saving a temp file or anything.
When you restart BB4W it doesn't come up with the program in the window, it's just a blank, new window. If you haven't saved your program regularly - and I'm now getting paranoid about saving after every line or two of code - it's all gone.
Sometimes I have worked on the program and then am called away for some reason, come back and find it all gone - and I wasn't even doing anything!
I've tried looking at the error messages which Microsoft invites you to send off, but they are all different (they refer to a different address each time).
The only clue I have is that the problem seems particularly bad if the program uses a text-edit window.
Re: Disappearing BASIC
Post by admin on Mar 9th, 2014, 1:59pm
the entire BB4W editing window disappears without saving a temp file or anything.
That is a classic symptom of a thread being left running when your program terminates. Ensure that the following are adhered to:
Never abort your program by clicking on the 'stop' button in the IDE's toolbar (or the equivalent menu item).
Check that every possible means of exit from your program is trapped, in particular ensure there are both ON CLOSE and ON ERROR handlers.
Check that PROCcleanup (or whatever it is called in your program) closes all windows and dialogues you have created, and check that it is called before any END, STOP or QUIT statements.
I guarantee that will fix the problem!
Richard. Re: Disappearing BASIC
Post by KenDown on Mar 9th, 2014, 8:24pm
Thanks, though that is a counsel of perfection, particularly when writing a program. You write d*2 instead of d%*2 and the program comes to a crashing halt (and even worse if the mistake is in PROCerror which should be closing all the bits and pieces you mention!
Nevertheless, I bodge along quite happily with the program crashing and being fixed and restarting and so on - right up until I include an edit window (code copied from your example program) and then the problems start.
So I close down BB4W, I even restart the computer, load the program into BB4W and don't even run it, just scroll through it to find the point where I left off and - bang! Gone!
However, interestingly, I have noticed that once the program is compiled, although the BB4W program still crashes and disappears, the compiled .exe is pretty stable, edit window and all.
Odd.
Re: Disappearing BASIC
Post by Matt on Mar 9th, 2014, 9:01pm
Thanks, though that is a counsel of perfection, particularly when writing a program. You write d*2 instead of d%*2 and the program comes to a crashing halt
Please don't use the emotive word 'crash' out of context. Writing d*2 rather than d%*2 does not result in a crash, it results in an error being reported (probably 'No such variable'). BB4W is not prone to crashing!
Quote:
Nevertheless, I bodge along quite happily with the program crashing
If you follow the recommendations I gave, it will not crash. They are things that every program should do anyway, but they become more important in the rare case when the program creates a new thread.
Quote:
until I include an edit window (code copied from your example program) and then the problems start.
If the example you are referring to is TEXTEDIT.BBC, that does not create a new thread, and cannot crash BB4W in the way you describe (at least, not with the current version of WINLIB5; there may have been a very old version of that library that did create a new thread).
If in doubt, run TEXTEDIT.BBC itself; it will not cause the IDE to crash, even if you use the Stop button.