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 / Compiles and Runs but closes out immediately...?

Author
Message
TheCompany
13
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 20th Sep 2011 02:11
Hello, I'm a bit new to Dark Basic and am following this tutorial: [Tutorial] Just Purchased DB? Want to make an rpg?

Whenever I try to compile&run the program the debug window comes up for a split second and closes out. This would occur in C# if you didn't type ReadLine(); in console apps. I have been searching google for the past hour but have come up with nothing on how to solve this.

I am using Windows Vista x64bit and running in administrator. I apologize ahead of time if this problem and a solution to this problem has already been posted but I cannot seem to find it.

Thank you for your help,
TheCompany
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 20th Sep 2011 07:08 Edited at: 20th Sep 2011 07:10
So, you're running it in debug mode and it does that? Can you post the code in a snippet?

Something I have done that usually works (but is tedious) is to rem out functions and subroutines one at a time and run the program to find out which one is causing the problem. Another method is to have the program pause every so often and tell you everything is okay, like this:


You can check for Vista issues here:

http://forum.thegamecreators.com/?m=forum_view&t=104612&b=1

EDIT: One other thing I can think of is maybe you need to update to the most current 9.xx version of DirectX (9.0c) - I believe there is a link to it in the Vista thread.

Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 20th Sep 2011 11:24
No, looking at the tutorial code I think it's much simpler than that!

Let me guess, a program as simple as this:

is causing the DBP window to open then immediately close?

If yes, then you need to add two commands to the program to make it work:


In the first version, DBP prints text to the screen and then finds no more commands to execute so the program has finished - and it closes, after a little under half a second. Wait key tells DBP to wait until some key on the keyboard is pressed, at which point DBP closes - but the wait key means the window stays open long enough for you to actually read what the computer put on screen!

We spend our lives chasing dreams. Dark Basic lets us catch some of them.

Login to post a reply

Server time is: 2024-11-27 19:14:55
Your offset time is: 2024-11-27 19:14:55