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 / There is 2 more problems..... DBC

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Aug 2006 22:42
Now after I put RETURN after each sub it shows the beginning of another one! I also need to know how to make it send e-mails. I don't care how experinced I am. I need to know! Please! and Thank You!

Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 1st Aug 2006 22:44
code?

Our aim is to keep the loo's clean, your aim can help.
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Aug 2006 22:52


Then After new_game is finished it shows file_save.

Not Really My Game. LOL

Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 1st Aug 2006 22:57
is this the full code or do you have subfunction calls to new_game and file_save or does it run as is?

BM

Our aim is to keep the loo's clean, your aim can help.
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Aug 2006 23:06
full code

flock
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 1st Aug 2006 23:38
You put the return command after every subroutine? Say you make a subroutine to load files or one to calculate an answer (a function would be better...) those are times you would really need the return command. You don't have to put anything at the end of a routine. I don't think I'm understanding your original question:

Quote: "Now after I put RETURN after each sub it shows the beginning of another one!"


a.k.a. "flockhound"
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 2nd Aug 2006 15:35
But, If I don't put return after every sub routine it shows it when it isn't supposed to!

Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 2nd Aug 2006 16:13
The whole point of a subroutine is that you call them, using gosub. So you'll need something like

gosub new_game

and only then the return statement will have any effect. Also, not a hope you're gonna get DB to send e-mails, it cant do it itself, and I havent seen any plugins that'll let you do it

Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 3rd Aug 2006 14:16
The main thing that I think you are forgetting is to put an END command between your main code and your sub-routines. If the computer ever finishes your main loop, (which if well written, it shouldn't), it will move on to the next commands - your sub-routines. And since it has not go-subbed to them, it will ignore (or perhaps crash at?) any RETURNs it runs into.


So corrected:


"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001

Login to post a reply

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