--- title: "The Amazing “Line Insert” Command" type: "article" slug: "the-amazing-line-insert-command" url: "http://localhost/article/the-amazing-line-insert-command/" markdown_url: "http://localhost/article/the-amazing-line-insert-command.md" published_at: "2024-01-28T18:08:31+00:00" modified_at: "2026-06-21T23:26:45+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "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…" category: - name: "Pro/File Updates" slug: "pro-file-updates" taxonomy: "category" url: "http://localhost/category/periodicals/pro-file-updates/" post_tag: - name: "1984" slug: "year-1984" taxonomy: "post_tag" url: "http://localhost/tag/year-1984/" - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Dan Pinko" slug: "dan-pinko" taxonomy: "indiv" url: "http://localhost/indiv/dan-pinko/" publication_r: id: 39136 title: "Pro/File Updates" type: "periodical" url: "http://localhost/periodical/pro-file-updates/" authors: "Dan Pinko" authors_r: - name: "Dan Pinko" slug: "dan-pinko" taxonomy: "indiv" url: "http://localhost/indiv/dan-pinko/" volume: "1" issue: "2" issues_articles: - id: 52730 title: "Pro/file Updates v1 n2" type: "issue" url: "http://localhost/issue/pro-file-updates-v1-n2/" pages: "5-6" pubdate: "April 1984" product_reviews: - id: 14729 title: "ZX Pro/File" type: "product" url: "http://localhost/product/zx-pro-file-2/" archive_link: false --- # The Amazing “Line Insert” Command 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. 1. LOAD ZX PRO/FILE. 2. Reduce capacity by at least 400 bytes by redimming D$ or by following the method given in UPDATES Vol. 1, No. 1. 3. Reserve the first 256 characters of D$ for machine code as explained in the previous article. 4. 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 ``` 1. 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. 2. 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 ``` 1. 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$ ``` 1. Add line 525. It should read: ``` 525 IF Y$="I" THEN GOTO 400 ``` 1. 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 ```