home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
tutor
/
l1p080
< prev
next >
Wrap
Text File
|
1990-05-16
|
4KB
|
95 lines
╔═══════════════════════════════════════════════════════╗
║ Lesson 1 Part 8.0 F-PC 3.5 Tutorial by Jack Brown ║
╚═══════════════════════════════════════════════════════╝
┌───────────────────┐
│ Compiler Turn On │
└───────────────────┘
We continue with our investigation of the words " [ " and " ] ".
If you are curious VIEW the words " : " and " ; " . Remember that :
means " begin definition " and you will find that its definition
contains the word " ] " which turns the compiler on. Similarly the word
" ; " means end of current word definitions and it will contain the word
" [ " to turn the compiler off again. We will have a complete
discussion of the application of " [ " and " ] " in a later lesson.
┌───────────────────────────┐
│ New ways to start F-PC. │
└───────────────────────────┘
When you type F at the dos command line prompt A:\> to start F-PC you
can if you wish use two command line parameters as follows.
C:\FPC>F <filename> <line of Forth to execute> <enter>
Both of these command line parameters are optional. The file name is
specified if you want to have F-PC come to life with a *.SEQ file
already open. To edit a file which is already open you can use the
short cut call to the EDitor. The short quick call is just
ED <enter>
Lets start F-PC with our file BOARD1.SEQ specified on the command line.
C:\FPC>F BOARD1.SEQ <enter>
When F-PC comes to life you will notice that the banner at the top of
the screen has the current open file listed C:WORK\BOARD1.SEQ. The last
line of the welcome screen also lists the current file and its size!
Current File = C:\WORK\BOARD1.SEQ of 512 bytes
To edit the currently open file just type:
ED <enter> <--- do this now!
You will move instantly to the checker board source file.
Press Shift F10 to return instantly to Forth with changes saved.
Press <ALT> F10 to return instantly to Forth with changes discarded.
You can also activate the editor by pressing <ESC> and selecting the
FILE menu using the right/left arrow keys and then using the up/down
arrow keys to select the options. Try <ALT> E for an even faster
way to activate the editor with the current open file.
You could also start F-PC , open a file , and begin editing the file
directly from the DOS A:\> prompt. Leave Forth and try this:
C:\FPC>F BOARD1.SEQ ED <enter>
If you don't want to start F-PC with a file open but you still want to
specify a line of Forth to be executed then you must replace the file
name specification with a " - " <---- that's a dash or minus sign.
For example to start F-PC and get the HELP information screen directly
you would type:
C:\FPC>F - HELP <enter> <--- try this too!!
You could even start F-PC, make a definition, execute it , and leave
Forth , all from the dos command line prompt. Try this now:
C:\FPC>F - : TEST 10 0 DO I . LOOP ; TEST BYE <enter> and you will see:
0 1 2 3 4 5 6 7 8 9 Leaving..
C:\FPC>
You can also open a file while in Forth by using the OPEN command.
Start Forth again with no command line parameters and at Forth's
" ok " prompt type
OPEN BOARD1.SEQ <enter>
You can now directly edit the file with the command
ED <enter> or <ALT> E
You can still use the command ESC and the FILE menu to choose a file
from the directory.
┌────────────────────────────────────┐
│ Please move to Lesson 1 Part 9.0 │
└────────────────────────────────────┘