Download HP BASIC for OpenVMS User Manual

Transcript
In the following example, because both INPUT LINE and LINPUT treat your
input as a string literal, BASIC interprets quotation marks, commas, and
semicolons as characters, not as string delimiters. When A$ is input with
the INPUT LINE statement, the carriage return line terminator is stored as
part of the string. The first PRINT statement tells BASIC to print all three
variables on one line, starting each one in a new print zone. However, when
BASIC prints the three strings, it prints the carriage return character at the
end of string A$; this terminates the current line and causes B$ to begin on a
new line.
INPUT LINE A$
LINPUT B$
LINPUT C$
PRINT A$, B$, C$
PRINT "DONE"
END
Output
? SINGLE, DOUBLE Return
? "GFLOAT" Return
? HFLOAT; REAL Data Types
Return
SINGLE, DOUBLE
"GFLOAT"
HFLOAT; REAL Data Types
DONE
The INPUT, INPUT LINE, and LINPUT statements can accept data from a
terminal or a terminal-format file. See Section 5.3 for information about I/O to
terminal-format files.
5.1.1.3 Enabling and Disabling the Question Mark Prompt
With the SET PROMPT statement, HP BASIC allows you to enable and disable
the question mark prompt.
By default, HP BASIC displays the question mark prompt. The following
example displays the default prompt string:
INPUT "Please input 3 integer values";A%, B%, C%
Output
Please input 3 integer values?
You can, however, disable the question mark prompt by specifying the SET NO
PROMPT statement.
SET NO PROMPT
INPUT "Please input 3 integer values";A%, B%, C%
5–4 Simple Input and Output