Correction

Author(s): Dick Wagner
Publication: The Plotter
Pub Details: The Plotter v10 n8 (Volume 10, Issue 8)
Pages: 3-4

One of our subscribers, J. B. Pegram, kindly points out an error in a correction we printed in the July issue of our newsletter. This pertained to having multiple inputs on one line.

GWBASIC accepts multiple inputs in the form

200 INPUT M,D,Y

The suggested correction for this was to use a separate input for each of 3 lines.

My mistake was in saying that Sinclair BASIC does not accept multiple statements in one line. As Mr. Pegram points out, Sinclair BASIC does accept multiple input statements if the proper syntax is used. A review of the ZX Sectrum manual on PRINT and INPUT shows some of the information not included in the 2068 manual (some in appendix A.) The 2068 manual states that like PRINT, INPUT uses the same separators that PRINT uses. As Mr. Pegram illustrates in his short demonstration program, separators may be commas, semicolons or apostrophes.

Our thanks to Mr. Pegram. We appreciate knowing that subscribers and others are looking at our material and sometimes trying out the programs.

Dick F. Wagner, Editor

  10 REM J.B. Pegram, LOS ANGELES, CA
100 REM This demonstration of the "INPUT" command may be useful.
110 REM The "INPUT" prompts are printed on the lower screen and await the proper reply.
120 REM Several inputs may be entered in sequence as long as the command is not ended by a colon.
130 REM The input request can be separated by semi-colons; commas; or apostrophes. The semi-colon leaves no space before the next print position. The comma tabs to the next tab position for the next print position. The apostrophy is the same as "ENTER and creates a new line for the next print position.
200 INPUT "var1 as v1=";v1;" var2 as v2=";v2," var3 as v3= ";v3 '" var4 as string variable a$= ";a$' "var 5 as string variable without quote marks at cursor reply position as b$= "; LINE b$
210 PRINT "var1 = ";v1
220 PRINT "var2 = ";v2
230 PRINT "vqr3 = ";v3
240 PRINT "var4 string variable a$ = ";a$
250 PRINT "var5 =string variable b$ = ";b$

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.