next up previous
Next: Running Programs Up: Guide to CodeWarrior Java Previous: Opening Project and Program

Basic Program Editing

The CodeWarrior editor works much like any other Macintosh or Windows text editor. Source files are displayed in editor windows. The mouse is used to select text by clicking and dragging. Use the Cut, Copy, and Paste commands under Edit to move text around. Undo can reverse the effect of many commands if you make a mistake.

The most noticeable difference from most editors is the way CodeWarrior displays programs on a color monitor. Program code, keywords, and comments are displayed in different colors. This effect is called syntax coloring. Another visual effect that the editor provides is balancing. Whenever you type ), }, or  ], the editor will momentarily highlight the corresponding symbol (, {, or [. If the highlighted left bracket is not the one you expected, or if the editor beeps because it can't find a matching bracket, check for extra or missing brackets.

There are editor commands to help indent code. The Tab key increases the indentation level, while Backspace decreases it. When you hit Return, the editor starts the new line with the same indentation as the previous one. To change the indentation of whole sections of code, select the lines and use Edit|Shift Left or Edit|Shift Right.

To save source files, use File|Save. CodeWarrior saves project files automatically; you don't need to explicitly save them.

IMPORTANT: Be sure to save your work frequently, particularly if you are creating a large program or have made many changes. Don't wait until you are done for the day. A power failure or machine crash could wipe out hours of work if you haven't saved files recently. You should also make a backup on a separate disk in case your master disk becomes unusable.


next up previous
Next: Running Programs Up: Guide to CodeWarrior Java Previous: Opening Project and Program
CS 100 Course
2000-01-20