What if, after finding all the occurrences of string "/2", you realize that you have made a mistake. You want them all to be "/4" instead. You can either go through every line that contains the string, or you can let the computer do it for us. This brings us to the last edit feature that I find note worthy. That is the command REP. To replace all occurrences of string "/2" with "/4" all we have to type is REP./2./4.,A and presto chango, it is done. This time I used the period "." as a delimiter, as long as the character used is not in the strings. If the "/,A" was left off the end, only the first occurrence of "/2" would have changed. You can even specify a line number range in which to replace, like the command "FIND". But what if you do not want to replace every occurance? If you tack an ",Q' on the end of the command instead of an ",A", the computer will list the line with the string and prompt you with a question "?". If you type a "Y" followed by a return, the string will be changed. If you just type a return, the string will be left intact.
To do 1/0 (Input/Output) to the editor, you have three statements that may be used. Loading a program into the computer is the function of the command "ENTER". You type the word ENTER followed by the pound sign "#", and the device to load from. Entering a program from the cassette is "ENTER#C:". From a disk file, you could use "ENTER#D:YIPPIE".
Saving a program is done with a variation of the "LIST" command. Normally the LIST command is used to list a program on the screen, "LIST", or on a printer. "LIST#P:". In order to save a program on the cassette recorder, we LIST it to device C:; LIST#C:. To save it on a disk file, one types "LIST#D:YIPPIE". The cartridge does have the commands "LOAD" and "SAVE" but these are used in the storage of binary load files only.
A variation on LIST is the command PRINT. PRINT does the same thing as LIST except it drops the line numbers in the process. I have not found much use for this command yet, except in one instance. One day while generating a data file of strings (yes folks, this cartridge does not check for syntax errors like BASIC does, because it does not store programs in a tokenized form). I had typed in the lines with line numbers so that the editor would not accept them as commands. After all the editing was done and the line numbers were no longer needed, I was going to write a BASIC program to read them in, and write them back out, minus the line numbers. Lee, however, came up with a great idea. "Why not do a PRINT to the disk drive with the data, then you don't have to write a conversion program", he said. You know, there may be hope for him yet.
Now, how would you like to use the added editing features on your BASIC programs. That is right! You can delete groups of lines, replace character strings, and enter lines with automatic line numbers. How do you do all this to your BASIC programs, you ask? First, after powering up with BASIC and loading your program, you LIST it to your storage device, be it cassette -C:" or disk "D:YIPPIE". Then you remove the BASIC cartridge and insert the Assembler/Editor cartridge. As ENTER from your cassette or disk is performed, and voila, you can now work on your BASIC program with a much superior editor. To go back, we simply LIST the program to the storage device, swap back to BASIC, and perform ENTER from the device in BASIC. Now, it is just a simple matter of resaving programs, and you are done.
In this issue, I have discussed only the features of the Editor. In the next issue the Assembler will be covered, which
allows you to produce machine language programs. And the Debugger, which allows you to examine memory locations, trace program execution, disassemble machine code, and many other things. This cartridge is well worth having, and like I said before, a long time in coming.
So you don't think I read articles before they go in Charlie??? Well next issue, you had
better get me that assembly language tutorial or no borrowing
any more science fiction video tapes! --Lee