Page 1 of 1

Debugger is too exact

Posted: Fri Sep 17, 2004 5:05 pm
by Tomio
a problem I stumble across regularly:

As an example:

leaving the program by a common end-routine, I stop/shut/close... things which still could be open, even if they are not open,

e.g. "StopDrawing()":

No problem without Debugger.

But with Debugger enabled, the Debugger stops the run immediatly if there was no "StartDrawing()" preceding. Additional code is not executed.

Is there a way around?

../tomio

Posted: Fri Sep 17, 2004 5:19 pm
by GedB
Tomio,

If you fail to include StopDrawing() then terrible, terrible things will happen.

The debugger is doing you a great favour. Whatever happens, always make sure that StopDrawing is called.

Posted: Fri Sep 17, 2004 7:07 pm
by tinman
GedB wrote:If you fail to include StopDrawing() then terrible, terrible things will happen.

The debugger is doing you a great favour. Whatever happens, always make sure that StopDrawing is called.
You got it backwards. He does always call StopDrawing(), but this also includes times when StartDrawing() has been included.

Tomio, I don't think there is a way around this without keeping track of whether you have started drawing using a variable or something. I'd like to see the ability for the debugger to continue from it's execution point if you want, but currently when the debugger is activated you cannot do anything but exit the program :(

Posted: Fri Sep 17, 2004 7:24 pm
by GreenGiant
I don't think there's any need to call anything in particular when you close the program, I'd have thought purebasic takes care of it all itself. If you've been writing to files and have those open, it might be worth closing them, but other than that, I'd guess it was safe.

Posted: Sat Sep 18, 2004 8:40 am
by GedB
Ooops. :oops:

Green Giant,

PB event takes care of the files.

The only thing I've found that doesn't get cleaned up automatically are ODBC database connections.

Posted: Sat Sep 18, 2004 11:13 am
by Tomio
Thank's everybody.

> don't think there's any need to call anything in particular when you close the program

Hmm, my impression in the past was different, but obviously wrong.

I'll do a test and remove all those cleanup.
If trouble comes up, I'll add a message.

../tomio

Posted: Sat Sep 18, 2004 11:36 am
by GedB
The one thing that doesn't get cleaned up is StopDrawing. That really has to be called whenever StartDrawing is used.

It is best to use small tight Drawing blocks, rather than calling it just once for the whole program.

Posted: Sun Sep 19, 2004 5:45 pm
by TIGER
Its a programmer obligation to close everuthing
when the programm ends.

Free memory, images , close files . e.t.c

If you dont do that in PB maybe no problem (still its incorect)
If you dont do that in VB or C++ you got problems.