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 / Programme disappears as soon as it is run

Author
Message
Epiphora
12
Years of Service
User Offline
Joined: 28th May 2012
Location:
Posted: 28th May 2012 22:01
Hi,

What I mean is if I write

print "hello"

then run the programme, the box flashes up and closes again so I can't see if it worked or not.

I have managed to advance to moving a cursor around the box by copying code but I can't do very simple things.

eg.

Print "Please Enter Your Name: ";
Input Name$
CLS
Print "Hello ";Name$

I copied this from Nickydude's pdf guide but when I run it as soon as I type my name and press enter the programme finishes and I don't see the "hello dave" message.

Does anyone know why?

BTW, I have only downloaded the free trial version to see how things worked before purchasing.

Many thanks...
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 28th May 2012 23:55
Try this

Programs will terminate at the end of their code, even when END is not called.

Epiphora
12
Years of Service
User Offline
Joined: 28th May 2012
Location:
Posted: 29th May 2012 00:13
Thanks, I did do that before.

Is that the only way?
Epiphora
12
Years of Service
User Offline
Joined: 28th May 2012
Location:
Posted: 29th May 2012 01:16
Thanks again nonZero, I just found what I was looking for in the tutorials

Hamish McHaggis' beginners

http://forum.thegamecreators.com/?m=forum_view&t=25076&b=7#post

I needed something to go from the VERY beginning

He uses the wait key command too
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 29th May 2012 11:12
Quote: "Is that the only way?"

You can also use loops to keep a program running. For instance:



You will probably find that you will use loops far more than the wait key command.

Epiphora
12
Years of Service
User Offline
Joined: 28th May 2012
Location:
Posted: 29th May 2012 13:53
Thanks, I didn't have the cls command so just repeated itself over and over.

Slowly getting the hang of it, day 3 now
Marabas
13
Years of Service
User Offline
Joined: 12th Dec 2010
Location:
Posted: 29th Jun 2012 20:53
Keep at it, the more you practice and follow the tutorials, the more it makes sense. Programming has it's own kind of structured logic and your brain takes a while to get used to thinking this way.

Signature removed by moderator. Please do not give out the meaning of life in an open forum.

Login to post a reply

Server time is: 2024-11-23 20:46:29
Your offset time is: 2024-11-23 20:46:29