Changes

Jump to: navigation, search

Locomotive BASIC

545 bytes added, 08:46, 10 January 2019
/* Functions */
==============================================================================
</pre>
 
==== <code>INKEY$</code> ====
: ''BASIC 1.0 & 1.1''
: '''FUNCTION''': INterrogates the KEYboard, returning the current $tring reflecting any key that is pressed. It provides operator interaction without hitting [ENTER] after every answer. If there is a key pressed, then the function responds. If no key is pressed, INKEY$ returns an empty string.
: In the example below, lines 40 and 70 tell the program to loop back to line 30 after interrogating the keyboard string.
: Checkts the keyboard and returns the string character of the key pressed. The string character returned is normally assigned to a string variable. If no key pressed'''Associated keywords''': CLEAR INPUT, a null string is returned.INKEY
: '''Example''':
<pre>
10 CLS
20 PRINT "Select Yes or No (Y/N)?"
30 a$=INKEY$
40 IF a$="" THEN 30
50 IF a$="y" OR a$="Y" THEN 80
60 IF a$="N" OR a$="n" THEN 90
70 GOTO 30
80 PRINT "You have selected YES": END
90 PRINT "You have selected NO":
run
</pre>
==== <code>INP (‹address›)</code> ====
205
edits