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.

DarkBASIC Professional Discussion / .exe randomly stops

Author
Message
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 29th Mar 2010 07:21
does anyone know why when i use the commands:


it causes my .exe to just stop working (i get the thing that says .exe has stopped working)
(I'm using this to go to another level and delete the objects from the last level)

heres the whole code if you want it
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 29th Mar 2010 10:12
You make your code unnessecery complicated with using GOTO and GOSUB, i try to avoid them and write my code in way i actually do not need them.I see you use multiple loops are they actually needed?For most games/applications 1 main loop will do.Actually best use of multiple loops is to break from main loop that handle the game and go to secondary which handle pause or menu+pause, and at certain conditions you go again to main loop.You have 3 or 4 main loops plus you use often goto, gosub and this can easy lead to big mess in the code, after few houndred lines you can no longer say what is where anymore and what is actually doing because it`s hard to find it.It`s not easy to find what is causing the problem at this point.You may consider to rewrite your code, exclude the code that is causing errors and work with one that is working.Clean it, peace by peace.Instead of goto and gosub`s learn about functions, they are very handy, and at most can do the same work.They have some restrictions you need to care about, but once you use it...you`ll see what`s the diference.And if you redone all this and still have problems(if you do it right i doubt to have any)post your code again here, because this is unreadable.I get lost in it, and believe you get lost also.

Where there is a will, there is a way.
I often edit my posts, that`s who i am

Login to post a reply

Server time is: 2026-07-26 21:12:04
Your offset time is: 2026-07-26 21:12:04