Terrapin Resources

Terrapin Logo 4 has been discontinued! Our new Terrapin Logo version is much more powerful and modern; we strongly recommend that you update to our latest release of the Logo programming language.

Chapter 3: Managing Your Workspace

Unless you save your work, you’ll have to start over to create the designs you’ve drawn and the procedures you’ve written. What a waste of effort that would be! This chapter explains how to save your work so you can use it again. You can save everything in one file and then later on, continue working as if you never stopped. You can save pictures and procedures in separate files, too. This allows you to use part of one project in another project without having to “re-invent the wheel.”

Save your work frequently so you don’t lose it. You never know when the next power failure will occur! It’s a simple step to take to save yourself a lot of frustration.

Printing Graphics

To print the Graphics window, select Print from the File menu or click on the Print button . Either way, Logo displays the Print a Window dialog. Select the Graphics window and then click on the OK button. You can make your printing smaller by adjusting the percent value in the Scale to text box.

Saving Graphics

To save the Graphics window to a file, select Save⇒Image As from the File menu.

In the Save image as dialog, enter a name for your design in the File name text box and then click on the Save button. You can browse to a different folder or device, if necessary. You can also select a different image format in the Save as type popup list box.

Your graphic image file can be reloaded into Logo or used by other applications that accept the format you used. On a PC for example, if you save your image as a BMP file and copy it to the Windows directory, you can use it as the background wallpaper.

If your drawing was created by a procedure, don’t forget to save the procedure, too!

Loading Graphics

To load an image file to the Graphics window, select Load⇒Image from the File menu.

In the Load image dialog, select the name of the file and then click on the Open button. You can browse to a different folder or device, if necessary. You can also select a different image format in the Files of type popup list box.

When you load an image file to the Graphics window, it replaces the current background image with the new image. You can get the original drawing back with undo, as long as you have not made any changes to the background that was loaded. Either click on the Undo button or select Undo drawing from the Edit menu.

Saving Your Environment

The environment includes just about everything that Logo knows about - your procedures, your drawing, the window positions, even aliases. If you save your environment before quitting Logo, then the next time you start Logo, everything will be back just as it was when you quit. It’s like having a pause button for your work in Logo so you can come back to it later and continue as if you never stopped working at all. The default environment save file is Environment.lgz.

You can also save your environment at any time by selecting Save⇒Environment from the File menu and choosing a file name in the dialog.

The environment is saved in a special binary format that is only useful for Logo. It’s a convenient way to save all of your work together in one file while you are working on a project. When the project is finished, you should consider saving the graphics and the workspace separately. Then, you can start work on another project with a clean environment.

Loading Your Environment

Your environment is loaded automatically each time you start Logo, as saved in the default environment file (Environment.lgz). It lets you pick up where you left off in your last Logo session.

Saving Your Workspace

The Logo workspace is the part of the environment that contains the procedures you defined. (You’ll learn about other things in the workspace later on.) When you save the workspace, all of the procedures you defined are saved together in the same file. Why save the workspace when it’s part of the environment? Environment files are in a binary format, but workspace files are in plain text, and can be viewed and modified in other editors (such as Notepad or SimpleText). Each different project you work on should be saved in its own workspace file to keep things organized. You may save your project in the main environment while you’re getting it to work right, but when it’s finished, you should save the workspace with a file name that describes the project. If you tried to keep all of your projects in the environment, it would become a cluttered mess after a while.

To save your workspace the first time, select Save⇒Workspace as from the File menu or click on the Save button.

Either way, Logo displays the Save workspace as dialog. Enter a file name that will help you remember something about your procedures and then click the Save button. You can browse to a different folder or device, if necessary.

Logo remembers the file name you used for your workspace. If you make changes and want to save your workspace again with the same name, select Save/Workspace from the File menu or click on the Save button. You will not see the Save workspace as dialog this time. If you want to use a different name, then select Save/Workspace as from the File menu.

The workspace files are saved as standard ASCII text files, normally with the extension ‘LGO’.

Printing Your Procedures

To see which procedures are currently in your workspace, type:

POTS shows the procedure title lines which contain the procedure name as well as the names of any inputs required. Sometimes, this is all you really want to know about your procedures. It’s a quick way to find out what’s in your workspace or to find out how many inputs a procedure needs if you forget.

To see all of the instructions of all of your procedures, type:

POPS is short for PRINTOUT PROCEDURES. To quickly maximize the Listener window, you can type:

TS is short for TEXTSCREEN. With the Listener maximized, it’s much easier to view your procedures. To return the Listener to its normal size, type:

SS is short for SPLITSCREEN. It does the same thing as selecting Standard Window Layout from the Window menu or clicking the Standard Window Layout button.

To see the instructions of a single procedure, SQUARE for example, you can type:

PO is short for PRINTOUT. You can put as many procedure names as you want after PO; this allows you to control the sequence in which the procedures are displayed.

To actually print the Listener window, select Print from the File menu or click on the Print button. Either way, Logo displays the Print a Window dialog. Select the Listener window and then click on the OK button.

The Listener window holds about 100 lines. If your procedures are longer than this, you can print them in smaller groups or use the Logo editor. In addition, you can change this limit using the LISTENER.LINES property of the “PREFS object.

To put all of your procedures in the editor, type:

To print the editor contents, select Print from the File menu or click on the Print button. Either way, Logo displays the Print a Window dialog. Select the Editor window and then click on the OK button.

Loading Your Procedures

To load a workspace file, select Load⇒into Workspace from the File menu.

In the Open dialog, select the name of the file and then click on the Open button. You can browse to a different folder or device, if necessary. Select the file you want loaded and click on the Open button. The contents of the file are added to the current workspace. This is a handy way to combine procedures from one project into another project without redefining the procedures.

Building a Library

A procedure library is a collection of procedures that are useful in many different projects. You can save individual procedures or a group of related procedures in their own file. When you need a procedure from the library, just load it into your current workspace rather than redefining it. It’s easier than loading an entire project file and then erasing the procedures you don’t need. Not every procedure belongs in your library and it’s easy to get carried away. Be selective about which ones you include.

You can create a folder to put your library procedures in to keep them separated from your other projects. In the examples here, the folder is called Library.

Saving a Single Procedure

To save a single procedure to its own file, use the Logo editor. For example, to save the SQUARE procedure, type:

The contents of SQUARE are displayed in the Editor window. Select Save⇒Editor as from the File menu. Logo displays the Save Logo file dialog. Select your library folder, enter the procedure name as the file name and then click on the Save button.

If you want a shortcut defined whenever SQUARE is loaded, add the ALIAS command as shown in the illustration. The alias must be outside of the procedure definition, after the END statement; otherwise, ALIAS will be run every time you draw a square.

Saving a Group of Procedures

When you have two or more procedures that must be used together, you should save them together in one file. Use the name of the super procedure as the file name, since it probably describes what the procedures are for. Sometimes, a group of procedures are related in some other way that makes sense to save them together. For example, SQUARE, TRIANGLE and RECTANGLE draw common shapes of any size. It makes sense to put them in a file called Shapes. To save these three procedures to a file, use the Logo editor. Type:

The contents of all three procedures are displayed in the Editor window. The order in which you type the procedure names determines the order in which they appear in the editor window. Select Save/Editor as from the File menu. Logo displays the Save Logo file dialog. Select your library folder, enter an appropriate file name and then click on the Save button.

If you want shortcuts for each procedure, add the ALIAS commands as shown in the illustration. The aliases must be outside of the procedure definitions.

Erasing Procedures

If you create or load a procedure that you no longer want in your workspace, you can get rid of it with the ERASE command. It takes one or more procedure names and removes them from the workspace. Be careful! Once the procedures are erased from the workspace, you can not get them back. Of course, if you saved them in a file first, you can just load them again.

Use ERASE to clean up your workspace before you save it. Otherwise, the clutter you have now will be loaded again and you’ll never get rid of it.

Once you save your environment, it is automatically loaded each time you start Logo. At some point, you’ll want to return to the environment that was in place the very first time you started Logo after it was installed.

To restore the original Logo environment, select Restart Logo from the Debug menu. This erases everything in your workspace and resets the windows to Standard Window Layout. Then, select Save/Environment from the File menu. The next time you start Logo, it will look like it did when you first installed it. An alternative method is to manually delete the Environment.lgz file from the Logo directory.