English
Language : 

NSB8 Datasheet, PDF (121/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
of experience with the editor, you will note a gratifying increase in your efficiency when entering
and modifying BASIC programs.
Now, try another example. Realize that, as soon as you strike the <CR> key to end the new line, it
became the old line, and you may now use the editor on it. Type
20
and don’t strike <CR>! Now strike <control-G>, you should see the following on your terminal:
20 PRINT “TOTAL RECEIPTS TO DATE: “ ,T2
If you strike <CR>, a new line 20 will be added to you current program. Its contents will be identical
to the contents of line 10. What you have done is create a completely new line by combining newly
typed information with part of the old line. When you typed the line number 20, you were typing over
the first two characters of the old line. When you pressed <control-G>, the line editor knew to copy
only the remaining part of the old line to the new line. The first two characters of the old line were
discarded in favor of your new information. Suppose that there had been no third character in the old
line, that it was only one or two characters long itself. Then, there would have been nothing for the
<control-G> function to copy to the new line. In this case, as in others where the editor can not comply
with your wishes, it rings the bell (or beeps the beeper) on your terminal.
THE EDIT COMMAND
So far, all that has been shown is only how the most recently typed line may be modified or used to
create a new line. What if, after typing line 20 in the example above, you want to go back and modify
line 10 again? This time line 20 would be the old line, not line 10. The editor would still want to work
with line 20. To surmount this problem, you can force BASIC to treat line 10 as the old line, by using
the EDIT command as follows:
EDIT 10
This forces the line editor to replace the natural (most recently typed) old line with the program line
you specify. In this example, line 10 would become the old line. Note that, if you type in other
commands besides EDIT, the command line itself becomes the old line. The EDIT command,
however, is the one exception to the rule of thumb mentioned earlier. When you strike <CR> after
typing the EDIT command, the command line is discarded, and the program line specified becomes
the old line instead.
Notice that there is no obvious response to the EDIT command: the cursor or print head simply moves
to the start of the next line. However, if you strike <control-G>, you will see that line 10 has indeed
become the old line, since it is immediately printed on the terminal. Using the EDIT command, you
can force any program line to be the old line, and thus you can modify any part of your program, or
create totally new lines by taking information from a forced old line, and combining it, under a new
line number, with newly typed information. The following discussed all the special functions of the
line editor, as well as some theory behind the editor’s operation.
NSB8
Rel. 5.10
Page 109