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.

Author
Message
rockabillypete
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location:
Posted: 8th Jan 2003 18:48
Hi cant seem to use gosub. looked in dbpro man and not much in there. just want to be able to use this i need to direct to a label what do i type. cheers fo any help
music is life
aw2003
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location:
Posted: 8th Jan 2003 19:42
type gosub and control jumps to where you told it to go, then when it reaches 'return' it jumps back to where it was

eg:
string$ = ""
gosub somewhere
print string$
end

somewhere:
string$ = "blah blah"
return

after doing the gosub, db will go back to the line after where it left.

Hope this helps
aw2003

aw2003
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location:
Posted: 8th Jan 2003 19:43
or if you just want to jump to the lable and continue there, use goto and you dont need to use return

rockabillypete
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location:
Posted: 8th Jan 2003 21:31
cheers i need this for q/a game i also in to know what to use ive tried input but that seems to be any key. I would like to use say a "n" key for no and a "y" key for yes. do i us inkey$.
cheers

music is life
aw2003
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location:
Posted: 9th Jan 2003 18:37
in qbasic, inkey$(1) waits for one character from the keyboard, but im not too sure about db.
If that doesnt work you can always ask for the input and if it isnt y or n then ask for the input again.

John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 9th Jan 2003 22:36
In Dark BASIC I use keystate. Use this code to find a keys keystate

DO
CLS
Print Scancode()
LOOP

Press the key you wish to get the value for, then use that number in the KEYSTATE() command.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!

Login to post a reply

Server time is: 2024-11-23 19:52:28
Your offset time is: 2024-11-23 19:52:28