Commodore 64 User Manual page 131

Hide thumbs Also See for 64:
Table of Contents

Advertisement

10 IF X > 10 THEN END
INPUT
The INPUT statement allows the program to get data from the user,
assigning that data to a variable. The program will stop, print a ques-
tion mark (?) on the screen, and wait for the user to type in the answer
and hit RETURN.
INPUT is followed by a variable name, or a list of variable names,
separated by commas. A message may be placed within quote marks,
before the list of variable names to be INPUT. If more than one variable
is to be INPUT, they must be separated by commas when typed.
10 INPUT "PLEASE ENTER YOUR FIRST NAME ";A$
20 PRINT "ENTER YOUR CODE NUMBER"; : INPUT B
INPUT#
INPUT# is similar to INPUT, but takes data from a previously OPENed
file or device.
10 INPUT#1, A
LET
LET is hardly ever used in programs, since it is optional, but the
statement is the heart of all BASIC programs. The variable name which
is to be assigned the result of a calculation is on the left side of the
equal sign, and the formula on the right.
10 LET A 5
20 LET D$ _ "HELLO"
NEXT
NEXT is always used in conjunction with the FOR statement. When the
program reaches a NEXT statement, it checks the FOR statement to see
if the limit of the loop has been reached. If the loop is not finished, the
loop variable is increased by the specified STEP value. If the loop is
finished, execution proceeds with the statement following NEXT.
121

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents