home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
tutor
/
l1p090
< prev
next >
Wrap
Text File
|
1990-05-16
|
5KB
|
96 lines
╔═══════════════════════════════════════════════════════╗
║ Lesson 1 Part 9.0 F-PC 3.5 Tutorial by Jack Brown ║
╚═══════════════════════════════════════════════════════╝
┌──────────────────────┐
│ The Banner Program │
└──────────────────────┘
Welcome back to the F-PC Tutorial. Did anyone investigate the
possibility of constructing a block letter alphabet? It turns out that
the demo program in the file BANNER.SEQ may provide some ideas to help
get you started in this direction. In this part of lesson 1 we are
going to work with the BANNER program. We are not going to explain how
it works at this time. What we need is a larger file to work with so
that we can explore some of the techniques for browsing and navigating
through *.SEQ files.
The file BANNER.SEQ is placed in the C:\FPC directory by the FPC
INSTALL program. You should move a copy of BANNER.SEQ to your WORK
directory.
Let's start F-PC and open the file BANNER.SEQ . There are at least two
ways to do this. From the FPC sub directory you can put the file name on
the command as shown below.
C:\FPC>F BANNER.SEQ <enter> <--- filename on dos command line opened.
Or from the root directory using your F.BAT file just type.
C:\>F <enter> <--- Start F-PC
ok <--- at the ok prompt
OPEN BANNER.SEQ <enter> <--- open the file BANNER.SEQ
( or use <ALT> O and choose BANNER.SEQ from the menu... )
( or use <ESC> and the "Open file" item in the FILE menu )
one of the last three ways is the most useful if you already have Forth
running. The first way is best if you happen to be in DOS. There is one
other difference between the above two methods of opening files. When a
file is opened by specifying its name on the DOS command line it is
known as the DEFAULT file. You can ONLY specify the DEFAULT file when
starting F-PC from the DOS command line. Why are we capitalizing
DEFAULT? You may have noticed that using HELP and VIEW change the name
of the currently open file. If you want to move back to the file that
was open before the last HELP or VIEW you must open it again. However
if you opened your working file by specifying it on the DOS command line
it is called the DEFAULT file and you can always reopen the DEFAULT file
by:
DEFAULT <enter> <--- You guessed it!
***** Handy TIP ****
F-PC is smart enough to know that if a file extension is not specified
then it should look for one with the .SEQ extension anyway! You could
have typed: F BANNER <enter> or OPEN BANNER <enter> and obtained the
same results.
┌────────────────────────┐
│ Browsing an Open File. │
└────────────────────────┘
It is possible to view or look at the contents of an open file without
using the having to worry about modifying the file. To do this type
BROWSE <enter> or B <enter>
Browse the BANNER.SEQ file... Use PgUp PgDn etc to move around the
file.
This time we are going to RUN the BANNER program. Start F-PC with
BANNER.SEQ as the default file. Do you know how to do this? There is
only one way. The default file must be specified on the DOS command
line when you start F-PC.
C:\FPC> F BANNER <enter> <--- Extension not necessary!
┌───────────────────────────────┐
│ Loading or Compiling a File │
└───────────────────────────────┘
To load or compile the source code of the currently open file we use the
LOAD command. The LOAD command takes one numeric parameter
specifying the line of open file where the LOADing should start.
<n> LOAD <enter> <--- Compile or load source code starting at
line <n> .
So... if we want to load the whole BANNER program, and the BANNER file
is currently open then we can just type:
1 LOAD <enter> <--- Load all of the currently open file.
Do this now. The BANNER program includes a DEMO and when it is LOADed
the DEMO will execute displaying a welcome message in large block
letters. F-PC also includes a shorter way of loading the currently open
file. It is the command OK
OK <enter> <--- Load all of the currently open file (same as 1 LOAD)
<--- We don't like this name but it is short!
┌─────────────────────────────────────┐
│ Please move to Lesson 1 Part 10.0 │
└─────────────────────────────────────┘