2

I certainly don't recall this at the time, but I'll ask to be sure.

According to the GW-BASIC documentation, a semicolon between the INPUT prompt and the variable suppresses the question-mark prompt.

I do not believe this was the case on the Apple or PET/C64, anyone have a sim handy to try?

My interpreter is coming along, if I get another day or two free I'll post it for people to try.

1
  • Your linked document says that it's the comma that suppresses the question-mark: A comma may be used instead of a semicolon after prompt string to suppress the question mark. There are also examples that are consistent with semicolon being the option with the question-mark.
    – dave
    Commented Nov 26, 2019 at 0:07

2 Answers 2

4

The comma syntax does not work in Commodore BASIC, neither on the PET (Commodore BASIC V4.0), nor on C64 (Commodore BASIC V2.0), C16/116 (Commodore BASIC V3.5) or Commodore 128 (Commodore BASIC V7.0). Using a construction like INPUT "ENTER SOMETHING",A$ yields a SYNTAX ERROR. There are however other ways to suppress the question mark prompt on a C64, see the answers to this question.

2
  • 1
    " Using a construction like INPUT "ENTER SOMETHING",A$ yields a SYNTAX ERROR:" - do you mean a semi in there, or the comma? This example is the opposite of your opening statement. Commented Nov 25, 2019 at 19:22
  • The comma syntax does not work in Commodore BASIC - thanks for the correction. INPUT "ENTER SOMETHING";A$ (with a semicolon) would be a valid statement when used in a program line.
    – Peter B.
    Commented Nov 25, 2019 at 19:23
0

INPUT with comma vs. semi

I'm not sure what this is supposed to ask, but ...

According to the GW-BASIC documentation, a semicolon between the INPUT prompt and the variable suppresses the question-mark prompt.

I do not believe this was the case on the Apple or PET/C64,

It was on the Apple and all other MS-BASIC versions, but not on the PET.

Examples:

10 INPUT A
20 INPUT "NUMBER"; A
10 INPUT ""; A

will display on an Apple II ("_ "being the cursor)

?_
NUMBER_
_

while the PET does always give the question mark and a space

? _
NUMBER? _
? _

In addition maybe relevant here that the ECMA-55 (1978) standard "For minimal BASIC" (adopted by ANSI as ANSI X3.60-1978) makes the whole prompt implementation defined and optional, while recommending:

   It is recommended that the input-prompt consists of a question-
   mark followed by a single space.

So Commodore's implementation is close to standard .. albeit I'm not sure if by purpose.

[Also, if you're about to write any new BASIC, make sure it is able to handle ECMA-55 programs as means for general compatibility. The National Bureau of Standards' Minimal BASIC Test Suite might be of help]

Later ECMA-116 defines that

  If an input-prompt specifier is present in the input-statement, then
  the implementation-defined input-promt shall not be output;

Though, it also requests a quite different syntax using keywords and a colon to seperate between modifiers and variable list:

INPUT PROMT "Name? ": A$

While using a keyword does allow for a prompt to be supplied in a string variable, the colon may tick off many. ECMA-116 is eventually a great language definition, but came way to late for any influence.


Input in (early) MS BASIC has another nice side effect when using the notation without assigning a prompt. A statement like

INPUT ;A

which should produce a syntax error right away when executed, will still first prompt for a value, only to break after it has been entered.

1
  • Not just the PET, but also VIC-20, C64 and even BASIC 7.0 on the C-128.
    – cjs
    Commented Nov 26, 2019 at 7:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .