?he 'EZYPOP''Page %'
?fo 'Steven Hardy'- % -'\*(DY'
.ce 2
Use of LOAD and PACK
====================

These two commands are intended to help you  use disc files.
.br
LOAD
.br
====
.br
This macro can be used to compile disc files, for example:
 	: LOAD SQUARE;
.br
will compile the file SQUARE.P.
Typically, you will want to use this command at the beginning
of a session with POP11, to make the POP11 system read in files you've created in
previous sessions.

If you want to LOAD several files you must give several
LOAD commands (see PACK).

.ce 1
- - - - - - - - - - - - - - -
.tp 10

PACK
.br
====
.br
This section should be skipped on a first reading of this document.
Let us suppose that you have written a number of functions which, taken
together, do some some task, say draw a house on the turtle picture.
It would be convenient if you could tell the POP11 system to
 	: LOAD SCENE;
.br
rather than having to say
 	: LOAD ROOF;
 	: LOAD CHIMNEY;
 	: LOAD WINDOW;
 	: LOAD WALLS;
 	: LOAD DOOR;
 	: LOAD HOUSE;
.br
where ROOF, CHIMNEY etc are the functions called by HOUSE.
.br
The command:
 	: PACK ROOF CHIMNEY WINDOW WALLS DOOR HOUSE AS SCENE;
.br
creates a file called SCENE.P which contains several LOAD commands
so that LOADing SCENE will LOAD the subsiduary files.
The command:
 	: PACK GARDEN WITH SCENE;
.br
adds an extra line to the SCENE file so that LOADing SCENE will now
also LOAD GARDEN.

.ne 6
So to create a new PACKed file give a command of the form
 	: PACK <set of file names> AS <file name>;
.br
and to add extra files do:
 	: PACK <set of file names> WITH <file name>;
.br
Try using PACK and then SHOW the resulting file.

.ce 1
- - - - - - - - - - - - - - -
.tp 10

A note on filenames
.br
===================
.br
In all the examples above files contained functions of the same name, for
example the file SQUARE.P contained the defintion of function SQUARE.
There is no need to stick to this convention - although it has obvious advantages.
Furthermore there is no reason why a file should not contain the definitions
of several functions (or, indeed, no functions at all - like the files created by PACK).
.sp
The POP11 system uses the convention that if you specify a file name
with a word (as in all the examples above) you are referring to
one of your own files and the file is a POP11 program file (and so should
have .P at the end).
This is sometimes inconvenient - one might want to look at someone elses files
or have a file without .P at the end. In this event specify the file name with
a string, for example:
 	: SHOW '/STD/MS/MARY/SQUARE.P';
.br
lets you see how MARY has written the SQUARE function.
 	: LOAD '/STD/MS/MARY/SQUARE.P';
.br
lets you use her function definition.
.br
UNIX text editor, ED.
To edit a program type:
 	: ED PROGRAM;
.br
To list a function type:
 	:TY PRGRAM;
