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 Discussion / Ok, stuck in the BASICS! (Text functions, lol.)

Author
Message
I am an idiot
18
Years of Service
User Offline
Joined: 25th Jul 2006
Location: Some Place Cozy
Posted: 3rd Apr 2007 05:42
Ok, here it is, I'm dyin' here trying to figure this out, I know nothing of this language but have general programming experience, so help would be appreciated, and should be well comprehended.

Here's my beginning code:




Thanks for the help! <3

======
Ok... So what?
I am an idiot
18
Years of Service
User Offline
Joined: 25th Jul 2006
Location: Some Place Cozy
Posted: 3rd Apr 2007 05:56
Ok, here it is, I\'m dyin\' here trying to figure this out, I know nothing of this language but have general programming experience, so help would be appreciated, and should be well comprehended.

*Edit*
Ok, I forgot to say what the problem is... My goal is to press N or C and one of 2 things occur:
N: It goto\'s to [u]new_game[/c]
C: It goto\'s to [u]continue[/c]

For some reason, it does both whenever I choose either n or c, help a brother out please?

Here\'s my beginning code:




Thanks for the help! <3[b][/b]

======
Ok... So what?
I am an idiot
18
Years of Service
User Offline
Joined: 25th Jul 2006
Location: Some Place Cozy
Posted: 3rd Apr 2007 07:40
I posted an edit earlier but I guess it just never went through, but ok, here is what I need help with.

My goal:

- To goto new_game when N is keyed.

- To goto continue when C is keyed.

- To stay at current menu when else is keyed.

What this does:

- It recognizes N and C, but it can't quite distinguish them. It loads both subroutines when either of them is keyed.

Help please?

======
Ok... So what?
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 3rd Apr 2007 11:17 Edited at: 3rd Apr 2007 11:20
Everthing is fine apart from the last line. Let me explain.

You set up a while loop to detect whether each key is being pressed or not and to store the answer in a variable called NGorC. That's fine.
Then you told the computer to either goto New_Game or Continue based on the answer given by NGorC. Thats fine. (By the way, it should be gosub and not goto)
Then after each of the gotos(gosubs) had finished you told the computer to go back to where it had left off, the "If NGorC=" line, with a return command. So each time a key is pressed it loads up one routine and then returns back to the if statement.

Does that help you?


Nothing is impossible...
I am an idiot
18
Years of Service
User Offline
Joined: 25th Jul 2006
Location: Some Place Cozy
Posted: 3rd Apr 2007 16:43 Edited at: 3rd Apr 2007 21:07
Yes, thank you, that did help, and I'm working on fixing it right now. Now all I have to find out is why my name changed from [mod edit] to "I am an idiot" ^_^

======
Ok... So what?
FredP
Retired Moderator
19
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 3rd Apr 2007 21:06
Probably because it didn't take too long for a moderator to figure out your original forum name was against the AUP.
We're not stupid.

Login to post a reply

Server time is: 2025-05-27 23:57:34
Your offset time is: 2025-05-27 23:57:34