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 / my gosub dont work

Author
Message
rockabillypete
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location:
Posted: 11th Jan 2003 01:00
Ive tried useing gosub but it keeps giveing me errors very strange
i dont think im writting anything wrong
music is life
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Jan 2003 01:02
But what are you writing? Give us examples.
rockabillypete
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location:
Posted: 11th Jan 2003 01:05
im trying to learn how to use it very basic at first

if inkey$()<>"e" then gosub peter
if inkey$()="e" then print "hello"
cls

peter:
print "peter"
return

music is life
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Jan 2003 01:08
What you are not doing is stopping th program running into your subroutine.

if inkey$()<>"e" then gosub peter
if inkey$()="e" then print "hello"
cls
end : ` <--- stop the program running into the subroutine.

peter:
print "peter"
return
rockabillypete
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location:
Posted: 11th Jan 2003 01:12
I changed it to this
do
if inkey$()="e" then gosub peter
if inkey$()>"e" then print "hello"
wait key
loop

peter:
print "peter"
return

seems to work now
there was no loop in it

music is life

Login to post a reply

Server time is: 2024-11-23 21:57:18
Your offset time is: 2024-11-23 21:57:18