ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Lesson 1 Part 5.0 F-PC 3.5 Tutorial by Jack Brown º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Welcome back. In this lesson we will take a look at how to use F-PC's built in editor. Our first program will is going to display a checker board on the display screen. Instead of typing the program directly line by line as we did with our simple databases we will type the program into a separate text file using the EDitor. The advantage is that it will be easier to fix our mistakes, (won't have to retype the whole program) and we will have a permanent copy of our final working program. In F-PC the default extension for Forth source code files is SEQ. Lets call the file that we will contain our checker board program BOARD1.SEQ where the 1 is for our first attempt (there may be many!). Before we start the EDitor let's make sure that the current directory is the work directory. Type: CD C:\WORK <---- or what ever you called your work directory. If you wanted to keep your files on the A: drive instead you could just type: A: CD A:\WORK <---- if you have a WORK sub directory on A: To start editing a new file called BOARD1.SEQ, Press and select the New File option and enter the file name BOARD1 when prompted to do so. You can begin editing a new file by pressing N and entering the file name when prompted to do so. Do this now and you should see something like the display below. ÉÍÍINSERT Line=1 Column=0 Page#=1 Lines=2 Characters=2 ÍÍÍÍÍÍ» º º º ( this takes up the full screen!) º º º ÈÍÍHELP=F1ÍÍÍÍÍÍÍÍÍÍÍFile = C:\WORK\board1.seq ÍÍÍÍÍMENU=ESCÍÍÍÍÍÍÍͼ The graphics display here is no match for Zimmer's! The editor is for the most part uses commands similar to the wordstar editor, sidekick editor, and those included with the Borland Turbo products. Use the Help function key F1 to get HELP screen and choose the SED-Help menu item for further help with the editor commands. Enter the following program using the editor. \ CHECKER BOARD PROGRAM \ Version Number: 1 \ Date: September 18, 1988 \ Author: : BLACK ( -- ) SPACE SPACE ; : WHITE ( -- ) 177 EMIT 177 EMIT ; : ROW1 ( -- ) CR BLACK WHITE BLACK WHITE BLACK WHITE BLACK WHITE ; : ROW2 ( -- ) CR WHITE BLACK WHITE BLACK WHITE BLACK WHITE BLACK ; : BOARD ( -- ) CR ROW1 ROW2 ROW1 ROW2 ROW1 ROW2 ROW1 ROW2 ; : CHECKER_BOARD ( -- ) BOARD CR CR ; ----- end of program ----------- and you will see: BLACK isn't unique <--- don't worry about this it means WHITE isn't unique ok <--- the Forth also has words BLACK and WHITE To test the program type: CHECKER_BOARD and you will see the checker board! If you have an error re-edit BOARD1.SEQ and fix it! and repeat the above process. That's all the room this time! ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Please move to Lesson 1 Part 6.0 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ