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 / If then command question

Author
Message
brink1963
2
Years of Service
User Offline
Joined: 18th Nov 2015
Location:
Posted: 18th Nov 2015 03:24
Why won't this line work?
if key$()="2" then credit = credit-2 else
Attila
FPSC Reloaded TGC Backer
14
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 18th Nov 2015 10:22 Edited at: 18th Nov 2015 10:26
You should write



There are basically 2 ways to use IF
LBFN
11
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 18th Nov 2015 18:01
Is this something like what you are trying to do?



key$() will not return anything from the keyboard, but inkey$() will. Attila is correct about your syntax being off.
So many games to code.....so little time.

Login to post a reply

Server time is: 2018-09-23 12:52:29
Your offset time is: 2018-09-23 12:52:29