Authors
Pub Details
Volume: 1 Issue: 1
Date
Pages
Here is a subroutine for the 2068 to simulate the full screen input feature of most other computers.
It was originally written for my son to practice his school spelling. Often, these exercises required that whole sentence he typed in and checked for correctness against a master list (data), but the omission of a period or an accent would necessitate the retyping of the whole sentence using the TS input routine.
With ‘full screen input’, a wrong entry only produces a buzzer and then returns to the input routine and mere editing is required — an attractive feature for my son.
All present editing features are supported: move right/left, caps shift, graphics, delete.
Full screen input has been written as subroutine which needs to be supplied with values for ‘X’ and ‘C’ (line and column) before calling. It returns A$ to deal with as you like. There is plenty of room for improvements and additions: word wrap, an underline cursor, an inverse video feature. As you see it here, it works.
10 REM FULL SCREEN INPUT By Jim Turner
11 LET a$="": LET y=1
15 PRINT AT x,c; FLASH 1;"L"
25 LET i$=INKEY$: IF i$="" THEN GO TO 20
30 IF i$=CHR$ 8 THEN GO TO 200
40 IF i$=CHR$ 9 THEN GO TO 300
50 IF i$=CHR$ 12 THEN GO TO 400
60 IF i$=CHR$ 13 THEN GO TO 600
70 IF i$=CHR$ 15 THEN GO TO 500
80 IF CODE i$<32 THEN GO TO 20
95 LET a$=a$( TO y-1)+i$+a$(y TO ): LET y=y+1
100 REM PRINT TO SCREEN
101 PRINT AT x,c;a$( TO y-1); FLASH 1;"L"; FLASH 0;a$(y TO);" "
105 BEEP .005,20
110 GO TO 20
200 REM MOVE LEFT
201 LET i$=""
210 LET y=y-(1 and y>1)
220 GO TO 100
300 REM MOVE RIGHT
301 LET i$="": LET y=y+(y<=LEN a$)
310 GO TO 100
400 REM DELETE
405 LET y=y-(1 and y>1)
410 LET a$=a$( TO y-1)+a$(y+1 TO )
420 GO TO 100
500 REM GRAPHICS
501 PRINT AT x,c;a$( TO y-1); FLASH 1;"G"; FLASH 0;a$(y TO )
510 LET i$=INKEY$: IF i$="" THEN GO TO 510
520 PAUSE 20: LET i$=CHR$ (CODE(i$)+47)
530 GO TO 95
600 PRINT AT x,0;a$;" "
610 RETURN