forums

TNT Basic Forums > Bugs!
Crash code
< Last Thread     Next Thread >
Author
Thread        Post A Reply

07-22-2003 16:12

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

The following code crashes TNT, giving no error messages. I commented the code I used to find which command caused the crash. At first it seemed to be the "set pen color" command, but I tried rearranging the commands and it stopped at another command. It will run the loop around 600 times and crash.


graphics mode 800,600
'int pFile
int color=0
'set directory game
'pFile=create file("CrashFile","Crsh","text")
repeat
open canvas 2,1,1
' file write pFile,"before set pen color"
' file write pFile,color
set pen color color
' file write pFile,"before painting gDialogFontCanvas"
canvas 2
paint canvas
' file write pFile,"end"
until mouse button


I have no idea what this is...took me a while to find it, and now I don't know how to fix it in my code.

07-22-2003 16:48

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

The solution

Before I posted, I was having a little trouble recreating the problem. Yes, I had the answer and zoomed right past it somehow :)

Anyway, moving the "set pen color" command so it comes after the "canvas 2" line (instead of before it) makes the code run fine.

07-23-2003 14:01

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Ahh well spotted. OK I've fixed the bug now - it happens if you use open canvas to reopen a previously opened canvas that is the currently targetted canvas.

If you close the currently targetted canvas, canvas 0 is supposed to become the targetted canvas until you issue another 'canvas' command. But this doesn't happen and the next drawing operation will cause a crash.

I'm assuming you want all your drawing to happen on canvas 2. To do this just put the 'canvas 2' command immediately after the 'open canvas' command. This will stop the crash and will work in the bug fixed TNT Basic also.

Cheers,

Mark

07-26-2003 22:04

Posted by:
DanLurie

Location:
Earth>USA>New Jersey>Clifton>My Chair

Click Here to Email DanLurie   Find more posts by DanLurie

quote:
This will stop the crash and will work in the bug fixed TNT Basic also.


What's the ETA on that?

07-26-2003 23:08

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Not sure, it's not imminent though. I'll keep you all posted.

Mark

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.