intel MCS BASIC-52 — Intel MCS BASIC-52 Versions 1 & 1.1 Operating and Reference Manual PDF (EN)

int e l 4.16 DESCRIPTION OF STATEMENTS STATEMENTS: INPUT MODE: RUN TYPE: INPUT/OUTPUT The INPUT statement allows users to enter data from the console during program execution. One or more variables may be assigned data with a single input statement. The variables must be separated by a comma. EXAMPLE: INPUT A,B Would cause the printing of a question mark (?) on the console device as a prompt to the operator to input two numbers separated by a comma. If the operator does not enter enough data, then MCS BASIC- 52 responds by outputting the message TRY AGAIN to the console device. EXAMPLE:

>10 INPUT A,B >20 PRINT A,B >RUN ?1 TRY AGAIN ?1,2 1 2 READY The INPUT statement may be written so that a descriptive prompt is printed to tell the user what to type. The message to be printed is placed in quotes after the INPUT statement. If a comma appears before the first variable on the input list, the question mark prompt character will not be displayed. EXAMPLES: >10 INPUT"ENTER A NUMBER,"A >10 INPUT"ENTER A NUMBER",A >20 PRINT SQR(A) >20 PRINT SQR(A) >RUN >RUN ENTER A NUMBER ENTER A NUMBER-100 ?100 10 10 - 47 -