See all articles from Pro/file Updates v1 n2
I found that I required an INSERT facility for a filing job I was working on. This one works very well. After these changes are made to ZX PRO/FILE you can create an open line between two existing ones in order to insert a new line of text. Whenever the cursor is blinking while you add or edit files, press “I” to INSERT.
- LOAD ZX PRO/FILE.
- Reduce capacity by at least 400 bytes by redimming D$ or by following the method given in UPDATES Vol. 1, No. 1.
- Reserve the first 256 characters of D$ for machine code as explained in the previous article.
- Add these lines to PRO/FILE and GOTO 9900. Lines 9900 to 9930 can be deleted once everything is entered correctly. Their only purpose is to allow you to enter machine code into DS.
9900 FOR X=1 TO 21
9910 INPUT Y
9920 LET D$(X)=CHR$(Y)
9930 NEXT X
- Enter the numbers given in column 2 of the “INSERT” listing. Ex: 1, ENTER, 239, ENTER, 1, ENTER, 42, ENTER, 12, ENTER, 64, ENTER, and so forth.
- Add BASIC lines 400 to 495 shown below.
400 LET F=0
410 LET G=0
420 IF Y=3 THEN GOTO 509
430 PRINT AT Y,0;" "
440 LET G=(15-Y)*33
445 IF G<=0 THEN GOTO 490
450 IF G>256 THEN LET F=1
460 LET D$(18)=CHR$ F
470 IF G>256 THEN LET G=G-256
480 LET D$(17)=CHR$ G
485 RAND USR (L-256)
490 PRINT AT Y,0;Q$
495 GOTO 509
- Change line 506 to:
506 PRINT AT 16,0;"PRESS ""C"" TO CLOSE THE FILE. ""J"" TO INSERT ARROWS TO MOVE THE "">"". HIT ENTER TO INPUT DATA";Q$;Q$
- Add line 525. It should read:
525 IF Y$="I" THEN GOTO 400
- Now GOTO 17 to get back into the program. When you press “I” while in the ADD/EDIT mode, every line of the displayed file from the cursor on will move down one line. If you have something written on the bottom line, it disappears.
“Insert” Disassembly
D$ DEC MNEMONIC
1 001 LD BC,495
2 239
3 001
4 042 LD HL,(16396)
5 012
6 064
7 229 PUSH HL
8 009 ADD HL,BC
9 084 LD D,H
10 093 LD E,L
11 001 LD BC,462
12 206
13 001
14 225 POP HL
15 009 ADD HL,BC
16 001 LD BC,231
17 231
18 000
19 237 LDDR
20 184
21 201 RET