Вы находитесь на странице: 1из 7

-------------------------------------------- -----

Appendix A

Logo Startup File


On the Logo diskette or your file diskette there is a file named s t a r t u p . It is loaded into your work space whenever Logo starts up. We have put the following procedures in that file: Full Name
ARCLEFT ARCRIGHT CIRCLEL CIRCLER READWORD RW

Short Name
ARCL ARCR

i I

Although we have been using these procedures as if they were Logo primitives, they are procedures we have written in Logo. If your Logo doesnt know about these procedures, you have probably rewritten your s t a r t u p file. You can type in the definitions below and put them in your s t a r t u p file. We saved them in the s t a r t u p file in such a way that, even though they are loaded into your work space, they do not appear when you use p o t s (printout titles), p o p s (printout procedures), or
POALL.

I |
I

These procedures as well as a r c i and a r c l i are organized into a package named a i d s . We use the command p a c k a g e to do this.
PACKAGE " A I D S [AR CLEFT ARCL ARCRIGHT! A R C R A R C R 1 A R C L 1 C I R C L E L C I R C L E R RW ! R E A D WO R D ]

When this package of procedures is loaded into your workspace, the procedures are available to you as if they were Logo primitives. They are not printed out with the other procedures in the work space. This is because the entire package of proce dures has been buried from view by the command
143

BURY

"AIDS

If you want to know what procedures are in a package, type


POTS "AIDS

and Logo will respond


TO TO TO TO TO TO TO TO TO TO ARCLEFT :RADIUS :DEGREES A R C L : R A D I US : D E G R E E S ARCRIGHT :RADIUS :DEGREES ARCR : RAD IUS :DEG REE S C I R C L E L : RADIUS C I R C L E R : R A D I US READWORD RW ARCR1 : STEP :TIMES ARCL1 : STEP :TIMES

The file s t a r t u p contains the information that these procedures are in the a i d s package. This is how we made the file.
SAVE "STARTUP [AIDS]
st a r t u p a id s

We saved in the file dures in the package

only those proce

You can put more procedures in s t a r t u p and then they will be loaded whenever Logo starts up. If you wish to do so put them in another package using the p a c k a g e command. For example,
PACKAGE "MINE [POLY SPOLY SPI]

Logo does not let you use the same file name again. Since s t a r t u p already exists, you will have to erase it.
ERASEFILE "STARTUP

Then when you save, type


SAVE "STARTUP [AIDS MINE]

144

Notice that we include a i d s in the list of packages to be saved. We do this so that s t a r t u p will con tinue to contain the procedures in the a i d s package.
Bug Box

To save your procedures and other Logo things you need a formatted Apple diskette on which you can write. If you do not have one you can make one or ask someone to help you make one. Using the Apple d o s 3.3 s y s t e m m a s t e r you can format a diskette. Put the diskette in the disk drive and start it up by repowering your Apple. Then when the disk drive light goes off, remove the s y s t e m m a s t e r diskette and replace it with the blank diskette you want to format. Now type
INIT HELLO

When the disk drive light goes off the diskette will be formatted. You can test this out by typing
CATALOG

The file name

h e l l o

should be displayed.

Now put the Logo diskette in the disk drive. Re power (reboot) the Apple. When Logo prints
PRESS I F YOU INSERT THE RETURN KEY TO BEGIN DISKETTE, RETURN H A V E Y O U R OWN F I L E I T NOW THEN P R E S S

press the r e t u r n key. Do not take the Logo disk ette out of the drive yet. Let Logo load in the s t a r t u p file from the diskette. After Logo prints

remove the Logo diskette and insert your file diskette. Now type
SAVE "STARTUP "AIDS

Now you have your own file diskette with its s t a r t u p file. You can, of course, change it.
a r c s

and

c ir c l e s

TO A R C R I G H T : R A D I U S : D E G R E E S ARCR1 . 1 7 4 5 3 2 * : R A D I U S :D E G R E E S / 10 I F 0 = R E M A I N D E R -.DEGREES 10 [ S T O P ] FD . 1 7 4 5 3 2 * : R A D I U S / 2 0 / R E M A I N D E R : DEGREES 10 RT R E M A I N D E R : D E G R E E S 10 END TO A R C R : R A D I U S : D E G R E E S ARCRIGHT : RADIUS :DEGREES END TO A R C L E F T : R A D I U S : D E G R E E S ARCH . 1 7 4 5 3 2 * : R A D I U S : DEGREES / 10 I F 0 = REM AI ND ER : DEGREES 10 [ S T O P ] FD . 1 7 4 5 3 2 * : R A D I U S / 2 0 / R E M A I N D E R : DE GREES 10 LT R E M A I N D E R : D E G R E E S 10 END TO A R C L ARCLEFT END : RADIUS : R A D I US : DEGREES : DEGREES

TO A R C R 1 : S T E P -.TIMES R E P E A T : T I M E S [ R T 5 FD END TO A R C L 1 : STEP :TIMES R E P E A T : T I M E S [ L T 5 FD END TO C I R C L E L : R A D I U S ARCL1 .174532 * :RADIUS END

:STEP

RT

5]

:STEP

LT

5]

36

TO C I R C L E R : R A D I U S ARCR1 . 1 7 4 5 3 2 * : R A D I U S END

36

Comments: These arc and circle procedures actu ally draw a 36-sided polygon. (The number .174532 is the result of computing 2 * 7 I 36; 7 is r r rounded to 3.1416; and 36 is the number of sides of the polygon.)
READWORD or RW
TO R E ADWORD OP F I R S T R E A D L I ST END TO RW OP R E ADWORD END

Вам также может понравиться