home *** CD-ROM | disk | FTP | other *** search
- Compiling source code
- ---------------------
- LOVE Forth allows considerable flexibility in the form of source
- code accepted. Programs can be loaded from screen format floppy disks,
- or screen files and text files under MS-DOS. These may be intermixed as
- desired and nested within each other up to ten levels deep.
-
- Many file words are named with a quote following (eg. INCLUDE",
- OPEN" ). These words are followed by a file name, or a path and file
- name (eg. INCLUDE" MYFILE.TXT" or OPEN" \WORK\SCREENS\PROG.SCR").
- There should always be a closing quote (it may be omitted when it is the
- last item on a line that has been keyed in). The word "CLOSE however,
- does not use a name. In this article the words block and screen are
- used interchangably, both meaning a 1024 character fixed unit of disk
- storage.
-
- In order to load source code from screen format files or floppy
- disks, the block handling words must be loaded. To load them type:
- INCLUDE" LOADBLK.TXT" . Once loaded they may NOT be removed as some
- kernel words are REDEFINEd.
-
- Loading MS-DOS text files
- -------------------------
- Text files are convenient and efficient in use of disk space.
- Therefore L.O.V.E. Forth accepts source code from text files. The word
- INCLUDE" followed by MS-DOS path and file name, loads the specified
- file. There is a file size limit of 65535 bytes.
-
- There are two ways available for convenient text editing during
- development. Pop-up editors are the most convenient method of editing
- source. Simply perform an interim saving of the work-file, exit the
- editor, and load. Most pop-up editors, however, are fairly limited.
- Stand-alone editors are accomodated by the LOVE Forth 'dos' command.
- Typing DOS followed by the path and name of the desired text editor,
- begins an editing session. To return to Forth, simply save the work,
- exit the editor, and load the desired file.
-
- There are several methods of commenting available in text files.
- The usual Forth comment ( ) works to a length of 256 characters. The
- line comment function \ works for one line (until carriage return is
- encountered). To comment out large portions of the text the words (( and
- )) are available. They may enclose any amount of space, and may be used
- around ( ) and \ . They may not be nested within themselves. To
- comment from one point to the end of the file, simply use (( without
- providing a closing )). Note that )) is a forth word and must be
- surrounded by spaces or end of line.
-
- The word EXIT is often used to exit from the compilation of
- a Forth screen. It may not be used for this function in
- text files. Simply use (( as is described above. In addition, the
- words --> , LOAD and THRU may not appear (LOAD" and THRU" may be used
- to load screens from another file, however).
-
- It is possible to load a screen file with INCLUDE" . In this
- case, however, it must not include any of the words described above or
- the Forth line comment \ .
-
- If an error occurs while loading a text file, the previous
- twenty-four successfully loaded lines are displayed, and the erroneous
- word is highlighted.
-
- Using screen files
- ------------------
- L.O.V.E. Forth supports editing and loading of screen files. A
- comprehensive screen editor and numerous utilities for screen handling
- are supplied. The maximum file size accomodated is 32767 screens.
-
- The word OPEN" followed by a filename, opens an existing screens
- file for editing. It becomes the 'current' file, which is accessed by
- block disk words such as BLOCK, UPDATE, .LINE etc.
-
- To display to contents of a screen on the display, there is a
- fast LISTing utility. Type: (screen-no) L to list a screen. The
- words LN, LB list one screen forward and backward respectively, LL
- relists the current screen. The word EL enters the full-screen screen
- editor at the current screen.
-
- The screen editor is a virtual vocabulary. It may be entered at
- the current screen with EL or by: (screen-no) EDIT . Typing control-X
- displays the help information. This editor provides facilities for
- general editing, 'gobbling' lines or words to a buffer, and moving from
- screen to screen. To save the screen and exit from the editor, type:
- escape and 'F'. Note that the 'gobble' buffers are lost if any
- compiling is performed, or if another virtual vocabulary is called in.
- Do not use the editor on a write-protected disk, as it always writes the
- current screen when moving between screens.
-
- To load from the current file, the words LOAD and THRU may be
- used. It is possible to load right from the editor by typing escape L .
- Arrow --> may be included to proceed to the next screen and EXIT may
- be used to terminate loading at a point on a screen. If any error
- occurs during loading, the erroneous screen becomes the current screen
- for listing and editing. The word WHERE will display the screen with
- the erroneous word highlighted.
-
- The word SHOW performs the rapid listing of a range of screens.
- To slow it down, store a value into the variable SHOWDELAY. INDEX
- prints the first line only, from a range of screens.
-
- To create a new screens file, the word OPEN-NEW" followed by a
- path and file name is used. It gives the file a starting size of two
- screens. To obtain a larger file size, type: (total screens) SCREENS .
- When in the editor, the file can also be extended, simply by advancing
- past the last screen in the file. To open a different file, simply use
- OPEN" or OPEN-NEW". The previous file is automatically closed. To
- close the file explicitly, the word "CLOSE may be used (no word
- preceeds it).
-
- To copy a range of screens from one place on disk to another the
- word COPYSCRNS may be used. Pass in the starting screen, ending screen
- and destination screen. Screens may be 'slid up' or down in the current
- file. To erase a range of screens, the word ERASESCRNS is used (pass in
- start and end screens). To put a header, with date time and screen
- number on a range of screens, use the word SCRNHDS.
-
- To copy screens from file to file, the word COPYF->F" is used.
- Pass in the starting screen and ending screen in the source file, and
- the first destination screen in the destination file. Follow this word
- with the source path\file and the destination path\file. For example:
-
- 0 10 5 COPYF->F" \my-dir\file1.scr"myfile.scr"
- There should be no space following the second " mark.
-
- To load a screen or range of screens from any screen file, the
- words LOAD" and THRU" may be used. The values passed in are the same as
- for LOAD and THRU, but the screens are loaded from the specified file.
- The words -->, LOAD, THRU may be used in the loaded file and operate
- within that file. Additional files may be loaded from within those
- files with additional INCLUDE", LOAD" or THRU" commands.
-
- If an error occurs while loading a screens file, that file is
- left open for editing at the errorneous screen. If an error occurs
- while loading a text file, no file is left open for editing. If there
- are no errors, the file currently open before the loading, remains so.
-
- Screen files may be converted to text files for more convenient
- programming. The free-ware program BUNBLOCK.EXE is provided for
- this purpose. Type BUNBLOCK with no arguments for help.
-
- Using screens format diskettes
- ------------------------------
- The traditional Forth source code storage is on floppy disks
- dedicated entirely to sequential screens. L.O.V.E. Forth supports both
- editing and loading of eight and ten sector formats. Disks are accessed
- by bypassing MS-DOS. Hard disks are not accessed. There are also
- several utilities for conversion of screen floppies to screen files.
- The screen format facility must be explicitly enabled before use, as
- follows.
-
- When no screen file is open, Forth accesses the floppy disks in
- screen format. All the block disk words and utilities described
- above may be used (LOAD, THRU, -->, SHOW, INDEX, WHERE, COPYSCRNS,
- ERASESCRNS). In addition the words LOAD", THRU", and INCLUDE" may
- appear on screens format diskette screens.
-
- There are two formats of screens floppy available. 8 sectors
- per track and 10 sectors per track (320 or 400k per disk). The former
- is the default setting. To switch to and from 10 sectors format the
- commands 10-SECTS-ON and 10-SECTS-OFF are used (in SCREEN-UTILS
- vocabulary). Floppy drives are treated as having contiguous screens.
- Screen 319 (399) is the last screen on drive A:, and screen 320 (400)
- is the first on drive B:. Note that accesses to floppies through
- MS-DOS functions confuse the screens format utilities (sets them to 9
- sectors/track). Two solutions to this: Refrain from using floppies for
- MS-DOS functions, or switch to screen files. Using virtual
- vocabularies from MS-DOS floppies will not cause problems.
-
- While a screens file is in use, and it is desired to list a
- single screen on a screens format floppy, use the command: (scrn_no)
- LSCRN . To copy from a screens format floppy to a screens file, the
- command COPYSCRNS->F" followed by the path\file of an existing file is
- used. The starting screen, ending screen, and destination screen are
- passed in. It is also possible to copy from a screens file to floppy
- screens with the command: COPYF->SCRNS" followed by the source file,
- and with similar arguments passed in.
-
- INITDISK will initialize a screens format floppy disk to the
- current sectors/track setting. This word normally initializes drive B:.
- To initialize drive A: execute the word SETDRIVES, which prompts for the
- drive to use. The word COPYDISK, copies the entire disk from drive A:
- to B:, and the word COMPDISK compares the two (two drives are required
- for both words). The word COPYNEW initializes drive B:, copies drive
- A: to B: and compares the two.
-
- The variable BLKMAX is used with screens format diskettes to set
- the maximum available screen. If it is desirable to limit the action of
- editing, listing etc, set this variable to the last usable block#. The
- variable OFFSET is also used primarily with screens format diskettes.
- Its contents are simply added to the block number on block operations.
- For example, to make screen 0 refer to the first block on drive B,
- type: 0 ONB OFFSET !
-
- Normally usage of screens floppy diskettes is disabled. To
- enable the usage of these obsolete media, type:
- SCREEN-UTILS ENABLE-SCRNS .
- To disable use:
- SCREEN-UTILS DISABLE-SCRNS .
- These changes may be made permanent by doing a SAVE" of the Forth
- system.
-
- Nested loading capability
- -------------------------
- L.O.V.E. Forth allows files to be loaded from within other files.
- This permits screen files and text files to be intermixed and
- nested ten levels deep. Simply include the appropriate loading
- word (eg. LOAD" or INCLUDE" ) in a screen or file.
-
- Load the following:
- Screen disk: Screen file Text file:
- From: Screen disk * * *
- Screen file * *
- Text file * *