APPENDIX 1 - Using the Blitz Editor 1. INTRODUCTION This appendix explains how to use the Blitz editor TED (which stands for "The Editor"). TED is used to create source code. N.B. TED can also be used to create normal text files. It is used in almost exactly the same way as when creating source code. The only differences are:- 1. Some features are not available. 2. The text is not tokenised. See section 3.4. 2. CREATING SOURCE CODE 2.1 Typing You create source code by typing it into the computer on the keyboard. You use the keyboard in a similar way to a typewriter. When you press keys on the keyboard the appropriate characters appear on the TED screen. As well as characters you will be able to see a little yellow box. It is called the cursor and shows where the next character you type will appear. As you type on the keyboard the cursor will move across the screen. If you press the return key a blank line will be created below the cursor. The cursor will also move down to the blank line. Pressing the delete key will cause the character under the cursor to be removed. Pressing the backspace key will cause the character to the left of the cursor to be removed. The tab key works in a similar way to a typewriter's. It moves the characters from the cursor onwards to the next column. 2.2 Moving About You can move the cursor using the arrow keys. Pressing the up arrow key moves the cursor up one line. Pressing the down arrow key moves the cursor down one line. Pressing the left arrow key moves the cursor left one character. Pressing the right arrow key moves the cursor right one character. If the program is longer (or wider) than the TED screen you can also move about by dragging the white scroll bars. There is one at the right of the screen and one at the bottom. 2.3 Selecting a Block of Text It is possible to edit a block of text. Before you can do this you must select the block. You do this using the function keys F1 and F2. Pressing F1 marks the start of the block. Pressing F2 marks the end of the block. When you have selected a block of text it will become highlighted. Section 4 describes the operations you can perform on a block of text. 3. THE PROJECT MENU 3.1 New This deletes the source code that you are editing from memory. 3.2 Load This allows you to load in a source code file that has previously been saved. The Blitz file requester will appear. See section 8 for a description of how to use it. 3.3 Save This allows you to save the source code that you are editing. The Blitz file requester will appear. See section 8 for a description of how to use it. 3.4 Defaults This allows you to change the default settings of a few TED options. A window will appear with various gadgets in it. At the top left of the window there are six labelled gadgets. These work as follows:- 1. Use Small Font - when this gadget is activated the text size is small. When it is not activated the text size is normal. 2. Tokenise - this gadget controls how TED remembers the source code that you are editing. When the gadget is activated the source code is tokenised. Use this method when editing programs. When the gadget is not activated the source code is not tokenised. Use this method when editing normal text. 3. Create Icons - this gadget controls what happens when you save the source code. If the gadget is activated an icon is created to go with the source code file. If it is not activated then no icon is created. 4. Horizontal Scroll Margin - this gadget contains the width of the horizontal scroll margins. These are two invisible margins at the left and right of the screen. If the cursor enters the left scroll margin the source code will be scrolled right. If the cursor enters the right scroll margin the source code will be scrolled left. If you click on this gadget you can edit it's value. 5. Vertical Scroll Margin - this gadget operates in a similar manner to the horizontal scroll margin gadget. 6. Tab Stop - this gadget contains the tab width. If you click on the gadget you can edit it's value. At the top right of the window there are eight gadgets. The top four are labelled Text Colour. The bottom four are labelled Token Colour. These work as follows:- 1. The Text Colour gadgets - these allow you to select the colour of the text. Click on one of the four gadgets to select the colour. 2. The Token Colour gadgets - these allow you to select the colour of tokens. Tokens are the words that Blitz highlights to make the text more readable. Click on one of the four gadgets to select the colour. At the bottom of the window there is the palette requester. This allows you to change the colour palette. TED uses a palette that consist of four colours. These are shown in four rectangular gadgets. Click on one of the gadgets to select it for alteration. The three slider gadgets labelled red, green, and blue allow you to change the colour selected for alteration. 3.5 About This displays the release number of Blitz and some credits. 3.6 Print This will print out the source code if you have a printer correctly connected to your computer. 3.7 CLI This starts a CLI. 3.8 Close Workbench This will close the Workbench screen if it is open. Closing the Workbench screen will free about an extra 40K of Chip RAM. 3.9 Open Workbench This will open the Workbench screen. 3.10 Quit This will quit TED. 4. THE EDIT MENU 4.1 Copy This inserts a copy of the selected block of text at the cursor's position. 4.2 Kill This deletes the selected block of text. 4.3 Block To Disk This saves a copy of the selected block of text to disk. The block is saved as normal text. 4.4 Forget This unselects the selected block of text. 4.5 Insert Line This splits the line into two at the cursor's position. 4.6 Delete Line This deletes the line which the cursor is on. 4.7 Delete Right This deletes text from the cursor onwards. 4.8 Join This joins the line which the cursor is on with the line below it. 4.9 Block Tab This moves the selected block of text right by one tab. 4.10 Block Untab This moves the selected block of text left by one tab. 4.11 Mark Indent This selects the text at the same indentation level as the line the cursor is on. 5. THE SOURCE MENU 5.1 TOP This moves the cursor to the top of the source code. 5.2 Bottom This moves the cursor to the bottom of the source code. 5.3 Goto Line This allows you to quickly go to a specific line of the source code. A requester will appear asking for the line number. Type it in and press return. 6. THE SEARCH MENU 6.1 Find This allows you to specify text that will be searched for in the source code. A requester will appear asking for the text to find. Type it in and click on next. TED will search from the cursor onwards for the text. If a match is found TED will move the cursor to it. If no match is found the screen will flash. If you activate the Case Sensitive gadget TED will only match text that has the same letters capitalized. You can also specify replacement text (see section 6.4) by typing it into the REPLACE gadget. 6.2 Next This will move the cursor forwards to the next place the text is found. 6.3 Previous This will move the cursor backwards to the previous place the text is found. 6.4 Replace This will replace the text found with new text. You specify the replacement text using the Find menu item (see section 6.1). 6.5 Replace All This will replace all occurences of the text to find with the replacement text. 7. THE COMPILER MENU 7.1 Compile/Run This compiles the source code into a program and stores it in memory. If the source code was compiled OK the program is run. 7.2 Run This runs a program that has already been compiled and stored in memory. 7.3 Create File This compiles the source code into a program and stores it as an executable file. The Blitz file requester will appear. See section 8 for a description of how to use it. 7.4 Options This allows you to change the settings of a few Blitz options. A window will appear with various gadgets in it. At the top of the window there are four labelled gadgets. These work as follows:- 1. Create Icons for Executable Files - this gadget controls what happens when you create an executable file. If the gadget is activated an icon is created to go with the executable file. If it is not activated then no icon is created. 2. Runtime Error Debugger - when this gadgets is activated the runtime error debugger is activated. If it is not activated the debugger is not activated. 3. Make Smallest Code - this gadget controls what happens when you compile the source code. If the gadget is activated Blitz makes the program as small as possible. If the gadget is not activated Blitz can compile the source code faster. When you create executable programs Blitz will always make the smallest code. 4. Create Debug Info for Executable Files - this gadget controls what happens when you create an executable program. If the gadget is activated the executable program will include a symbol table. The symbol table may be used by "executable program debuggers". Below these four gadgets are six gadgets that control the buffers. The buffers are only set to the sizes shown when the Make Smallest Code gadget is not activated. If the gadget is activated the smallest buffer sizes possible are automatically set. Below these six gadgets is a panel labelled Object Maximums. This is where you set the maximum numbers of the different Blitz objects. You can click on the up and down arrow gadgets to move through the list. Click on the numbers to edit them. To the right of this panel is another one labelled Resident. This is where resident files are installed. You can click on the up and down arrow gadgets to move through the list. Click on a blank position to enter a new resident file name. 7.5 Create Resident This creates a resident file if the source code has been compiled. The Blitz file requester will appear. See section 8 for a description of how to use it. 7.6 View Type This allows you to see the definitions of all resident types. Click on a type see it's definition. 7.7 CLI Argument This allows you to specify the CLI arguments that your program will receive if it has been compiled into memory. 7.8 Calculator This provides a calculator that supports binary, decimal, and hexadecimal numbers. 7.9 Reload All Libs This will reload all files in BLITZLIBS: into the Blitz compiler environment. 8. THE BLITZ FILE REQUESTER The Blitz file requester is used to select a file and to change the current directory. At the top of the requester is a description of what will happen to the file selected. Near the bottom of the requester are two gadgets labelled PATH and FILE. The PATH gadget shows the search path used to find files. The FILE gadget shows the file selected (using the search path). Above these gadgets is a list of the directories and files found using the search path. If you click on a directory the search path and PATH gadget will change. The directories and files found using the new search path will be listed. If you click on a file it will become the selected one and the FILE gadget will change. At the very bottom of the requester there are five gadgets. These work as follows:- 1. OK - this will indicate that you have selected a file. 2. DRIVES - this will list the drives available. Click on one to select that drive and change the search path. 3. PARENT - this will change the search path to the parent directory of the current search path. 4. CD - this will change the current directory to the search path. See below for a description of the current directory. 5. CANCEL - this will indicate that you do not want to select a file. 8.1 The Current Directory. The current directory is where Blitz will look for files if not told to look elsewhere. A common mistake is to forget to change the current directory when required. If a program cannot find the file it is looking for, the current directory is probably wrong.