Editing a Program

How do I type things to make a program?

To type text into a program, you must make sure the mouse pointer is pointing inside Karel's Programming Environment window. It can be pointing either at the lists of instructions, or the text window, or the world-view window. Any typewriter keys you press on the keyboard will cause characters to be inserted into the text-window wherever the caret appears.

What is the caret?

The caret is a mark (^) that appears in the editor window to show you where characters will be inserted if you type on the keyboard. It always appears to be either pointing between two characters, or at the end of what has been typed.

How can I move the caret?

You can move the caret one of two ways:

How do I erase characters from the editor window?

If you press the delete or backspace key (usually near the upper right side of the main keyboard), the character just before the caret will be erased. If the caret is at the beginning of a line, the carriage return will be erased, joining the preceding line and the current line together

You can erase a large portion of text by selecting the text and then pressing the Cut key (usually on the left side of your keyboard). You select text by pointing (with the I-beam) to the beginning of the text you want to select, pressing the button down (without releasing it), moving the I-beam to the end of the text you want to select, and then releasing the mouse button. The text you have selected will be highlighted.

How do I use theINSTRUCTIONS, PRIMITIVES, and TEST FUNCTIONS lists?

If you point the mouse pointer at any of the items in this list and click the mouse button, then some associated text will be placed in the editor window as if you had typed it on the keyboard.

The text that is inserted in this way will be indented according to a set of rules used by the programming environment.

How do I save the program I edited? How do I edit a program that's already saved?

You can save and load programs in files by using the FILE MENU button above the editor window. When you press this button, a file selection box will appear. All Karel programs must have file names with .karel at the end of them (e.g. program.karel).

Why can't I press the Save Program button in the file menu?

If you can't click Save Program in the FILE MENU, then the CURRENT FILE listed in your edit window is (None), that is, your file has no name. Instead of trying to use Save Program, you should use Save Program As instead.

What if I Cut some text I didn't mean to?

If you just cut some text, you can paste the same text back in wherever the caret appears with the Paste key (usually on the left side of the keyboard).

File Selection


This document is copyright 1994 by Joseph N. Wilson.
$Id$