Now remove the word "MacFORTH" by selecting it and "cut"ting it out: click at the beginning of "MacFORTH", drag to the end of the word (it is now displayed in inverse characters) and release the mouse button when the entire word is selected (entirely in inverse characters). Select the "Cut" item from the
"Edit" menu; the selection range is now deleted and saved on the clipboard.
Bring it back by selecting "Paste" from the "Edit" menu.
You can now reposition the insertion pOint and paste the word "MacFORTH"
anywhere in the current block. You can even move to a different block and paste it in that block! This should give you an idea of the power of the editor.
You can cut or copy a selection from any block and paste it into any other block.
Cleaning a Block
The "Clean" item in the "Edit" menu allows you to completely erase the current block being edited (filling the block buffer with blanks). THIS COMMAND CANNOT BE UNDONE .. so use it with caution. You can only revert to the version of the block saved on disk.
Reverting to the Last Version
The "Revert" item in the "Edit" menu al10ws you to revert back to the old version of the block (from disc). AI1 changes made to the block since it was last read in from disc wil1 be lost. THIS COMMAND CANNOT BE UNDONE ..
so use it with caution.
Program Editing Page 3 - 10 June 3, 1984
The Editor Stamp
The MacFORTH stamp allows you to mark a block with your initials and the current date. Using this method informs you and others who last changed the block and what day the change was made. Vou should "stamp" the screen (by selecting the "Stamp" item from the EDIT menu each time you modify a block with the editor.
Loading Blocks
To load a block from disc, execute the LOAD command in the following form:
<block.) LOAD
For example, to load the block you were editing, execute
5 LOAD
When a block is loaded, the source code on the screen is interpreted just as if you had typed it in from the keyboard. This enables you to mix definitions and commands to be executed immediately.
Error Detection While Loading a Block
If MacFORTH encounters an error while loading a block (an undefined word, a typo, missing del1miter, etc.), it wi 11 abort immediately and issue an error message. To find where the error occurred, simply enter the editor. The insertion point (flashing vertical bar) will be located just after the error.
For example, if you have the sequence
QUERTY
in a block (and it was not a deflned word) when you loaded the block, the insertion pOint would be one space after the "V". This feature is invaluable for locating the cause of an error during loading because it shows you where MacFORTH encountered the error.
Program Editing Page 3 - 11 June 3, 1984
Listing Programs
The following words are provided to enable you to list your programs to the display and/or printer. If you have an Apple Imagewriter connected to your Mac, select the "Printer" item from the "Options" menu to turn it on. All output to the screen will be sent to the printer as well.
LIST
Displays the specified block. The data, screen numbers, and lines of the block ( numbered 0-15) are displayed. For example:
10 LIST
would list the contents of block 10.
INDEX
Displays the first line of a range of blocks. If you follow the convention of using the first line of each block as a comment describing the contents of the blOCk, INDEX will allow you to see quickly what a range of blocks contains. For example:
5 15
IHDEX
would display the first line of blocks 5-15, with the block numbers displayed on the left.
TRIAD
Displays three sequential blocks on one page, starting with a block that is evenly divisible by three. You specify the number of any block in the
"triad" that you want to display. For example:
10 TRIAD
displays blocks 9, 10 and 11. This enables you to update your program listings with only the screens that have changed. The icon used for MacFORTH blocks (program) files contain three rectangles to deSignate triad listings.
SHOW
Displays a range of blocks (as a series of triads). Given the starting and ending blocks to
displaYi
SHOW generates a listing of triads. For example:10 20 SHOU
would generate a listing of three blocks per page containing the specified range of blocks (it would actually list blocks 9-20).
Program Editing Page 3 - 12 June 3, 1984
Copy i
ng
BlocksThe following routines allow you to copy the contents of one block (or blocks) to another (or others).
Single Block Copying
When copying limited numbers of blocks, use the COPY command in the following format:
<source block-> <destination block->
COpy
For example, to copy the contents of block 6 to block 5, you would execute:
6
5 COPY
Multiple Block Copying
If more than a couple of blocks need to be copied, a copying utility program is available. Load these routines by loading block 10 of the "FORTH Blocks" file.
To copy a series of blocks from one location on the disc to another, use the COPY.BLOCKS in the following format:
<first> <last> <target>
COPY.BLOCKS
For example, to copy blocks 3 thru 7 to screens 12 thru 16, execute:
3
7 12COpy , BLOCKS
(just an exa.plej do not try this no.!) During the copying procedure, you are shown which screens are being accessed with the following message:sss -) ddd
where sss is the source block number and ddd is the destination block being copied.
Copying Blocks from One File to Another
Load the block transfer routines by loading block 12 of the "FORTH Blocks"
file. The word XFER.BLOCKS will al10w you to copy blocks between files, promting you to enter the required information. You will be asked for the file numbers of both files as well as the range of blocks to be transferred.
Program Editing Page 3 - 13 June 3, 1984