Remote-processing BASIC 52 Uživatelský manuál Strana 67

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 163
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 66
RPBASIC-52 PROGRAMMING GUIDE
2-48
INPUT
Syntax: INPUT ["prompt text"] [,] [,variable ...]
Where: prompt text = optional text
variable = list of variables to assign
Function: Program pauses to receive data entered from the console input.
Mode: Run
Use: 100 INPUT "Enter batch number",$(0)
Cards: All
DESCRIPTION
INPUT brings in numeric and string data from the console serial port during execution. Variables are string,
numeric, or both. Variables are separated by a comma. Optional prompt text must be enclosed i n quotes.
When an optional com ma precedes the first variable, the question mark prompt character is suppressed and
data entry is on the same line as prompt text.
Multiple numeric data may be entered by separating individual values with commas and using <cr> on the
last one. Or, ea ch dat a entry may be entered using a < cr>.
Strings must be entered with a carriage return.
If you do not enter enough data or the correct type, Basic sends the message TRY AGAIN and prompt text
after which you must enter all the data. If you enter too many characters for the size of allocated STRING
memory, or more numeric values than were requested, Basic discards the extra data, emits the message
EXTRA IGNORE D, and continues execution.
There are two major differences betwe en RPBASIC-52 and BA SIC-52 while using INPUT. Input characters
are buffered. The operator or device may "type ahead" into the buffer and INPUT will respond just that much
quicker. The back- space character (A SCII value 08) is recogniz ed in th e same way as the delete key w as.
This makes editing programs more convenient.
RELATED
COM$, GET, STRING
ERRORS none
EXAMPLE
10 STRING 200,20
20 INPUT "Enter a number, string, and 2 more numbers: ",A,$(0),B,C
30 PRINT "String:",$(0)
40 PRINT "Numbers:",A,B,C
>run
Enter a number, string, and 2 more numbers: 4,Bob
?7,9
String:Bob
4 7 9
Zobrazit stránku 66
1 2 ... 62 63 64 65 66 67 68 69 70 71 72 ... 162 163

Komentáře k této Příručce

Žádné komentáře