The editor is a separate program called WinView. This is a full ASCII source file editor with multiple open files, copy/paste, find/replace, formatting, hypertext and much more. Most of the commonly used commands are available from the toolbar, these and others from the menu bar.
To edit a file from Win32Forth use ED to open WinView or Ctrl+O to open an existing file. To create a new file use ED to start WinView and then click on the New File icon on the left of the toolbar.
The source for any word already compiled in Win32Forth may be displayed with ED or VIEW followed by the word required. ED will enter WinView in the edit mode where the source maybe modified. VIEW enters in the Browse mode, a dark blue border to the left of the source, where the text may be viewed but not changed. The Shft+F9 keys will toggle between edit and browse modes. The mode is also shown to the right of the toolbar icons.
WinView allows hypertext links to other parts of your application but to do this you need to create an index file. This function is under Hyper on the menu bar. It may be necessary to edit the configuration file to select the path for your application files prior to building a new index. When the index is built you will be able to click on a word in your application and jump directly to the source.
Comments may be incorporated into your source in three ways:
COMMENT: or /* ...... COMMENT; or */
\
( or (S ..... )
COMMENT: to COMMENT; is used to enclose several lines of comment.
The \ ignores any further text on that line only. Starting a block of lines with \ may be used instead of COMMENT:.
The ( or (S ignore all text until the ) is encountered. This is used for the stack comments.
All the comment words require a following space before the text. As COMMENT: is an Win32Forth function the word FORTH should be placed before it or it will not be found if compiling in Remote.
if you wish to print out a remark or comment while a file is being interpreted or compiled use:
CR .( Comment string )
This will issue a Return and then print out the string on the Host terminal.
Win32Forth supports Windows help with the Win32API help file. The latest WinView supports HTML files in the Browse mode and the ANSI Forth specification is available from the Help popup on the menu bar. The IRTC manual is also supported this way and you may create your own HTML help files for your application either with an HTML editor or directly with WinView.
Note: For WinView to find the HTML files for the IRTC manual it is necessary to set the WinView preferences, Ctrl+Shft+P, to the path of the HTML files drive:\Win32For\AVR\AVRMan.
The Editor date stamps your text when the Ctrl+Shft+V key sequence is used.
Once a file has been edited it may be compiled to produce the AVR runtime code with:
FLOAD <filename>
If the file has a .F extension, the default, non need be added to <filename>. FLOAD scans the file from beginning to end and interprets the contents from the dictionary. If you are in the Host mode the Target image only is updated. If in Remote the code is also programmed into the AVR for immediate execution.
INCLUDE is an alias for FLOAD and may be used instead if you prefer. This reads better when used to load, include, a file from within a file.
If a particular file is required before some code may be compiled, a Library extension for example, the word NEEDS may be used instead of FLOAD. This tests IRTC to see if the file has already been loaded and if not performs an FLOAD.
To print out a file we must first be in WinView the editor. Using the filename or by selecting from the file dialog the file to be printed is loaded as if for edit. The Page Setup may be selected from the menu bar under File to select one, two or four Forth pages to one printer page. The file may then be printed by selecting the print icon on the toolbar.