Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Bypass Error

Author
Message
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Aug 2009 18:23
Hello, This may Sound abit stupid, but it would be helpful if someone could explain to me if it is possible to bypass an error.

By this I mean, for example, if i got an image does not exist error, or invalid image number would there be a way to force the program to save before closing?

Omricon W.I.P
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 17th Aug 2009 20:24 Edited at: 17th Aug 2009 20:25
I'm not sure,if that is possible, but you could make your own paste image command which checks first if the images exist, and if it doesn't, it writes the file, image number etc to a file, and then exits with a message box or something.

And another thing: there are no stupid questions, only stupid answers

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th Aug 2009 23:38
Yeah, as Bobbel suggested you can check if the image exists before you try to use it. Do it right and you won't have to do an emergency save before it quits prematurely because it won't quit when you don't want it to.



Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Aug 2009 23:53
I understand that it would make more sense to fix the problem. however. i'm not sure whats causing it. and it doesn't get the error until i advance so far into the Game. So it would be easier if I could restore my progress afterwards. thanks for the advice. i'll give it a try

Omricon W.I.P
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Aug 2009 00:31
Np.

When I'm not totally sure where a bug is I create a debug file... basically all it does is store strings of text from the program as the program is running to show you what your program is doing.



The above will eventually error out because it'll pick an x and y coordinate that's too close to the edge of the screen for x+50 and y+50 to be within the screen resolution. To find out why it errored out open debug.txt and look at the last line. That last line should be coordinates that are beyond the screen size. So if you do the same thing for your program writing out the image numbers being used (before their used) you'll quickly see which image number doesn't exist by looking at the last line.

But of course if you really can't find it that's why the Darkbasic forums exist. Post your code and we'll do our best to find the error(s).

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 18th Aug 2009 01:12
Thankyou very much,
normally i would post some code, but my programs getting quite big now so the error could be , well anywhere, i will try the debug file, but theres also alot of variables. But im sure ill get it

Thanks

Omricon W.I.P
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Aug 2009 07:31
Np. I'm sure you will.

Login to post a reply

Server time is: 2024-09-28 10:36:31
Your offset time is: 2024-09-28 10:36:31