Blitz:Editor

From Amiga Coding
Jump to: navigation, search

The Blitz editor is the centre of all your Blitz coding activities, and is integral to the compiler itself. Starting Blitz Basic or AmiBlitz will launch the editor on its own screen. For Blitz Basic 2.1, this editor is called TED, and is a little limited but still covers all the standard features. The Blitz Support Suite includes a much better editor called SuperTED, and if you're still using Blitz Basic then I would recommend using this editor instead.

AmiBlitz 3 replaces TED and SuperTED with a new editor called PED. This offers many more features and improvements over the previous editors, such as better font sensitivity, window-based screen layout, library reference windows, tabbed editor window for editing multiple files and so on.

Using the Editor

The editor works much as any other text editor does, with a few quirks to remember and Blitz-specific features included. Text can be entered in the main editor window, where it will be tokenized and highlighted once the cursor moves off the current line.

The older editors have some peculiarities, especially the original TED - for example, the clipboard isn't shared with the system, text isn't carried onto the next line when pressing enter, nor is it joined to the previous line when pressing backspace at the left margin. PED fixes many of these issues to give AmiBlitz a much more modern feeling editor. Later versions of PED also include a keyword completion feature for the AmiBlitz include procedures: Typing the start of the procedure name (for example dos_) will open a pop-up menu that lists all the procedure names that match the characters typed so far. Typing more characters will update the list in real time.

Context-Sensitive Help

At any time, context-sensitive help for the current command can be summoned by pressing the Help key with the cursor on a keyword. This will display the keyword's syntax in the screen's title bar for easy reference.

AmiBlitz also includes the ability to open the help documentation at the appropriate section for the keyword. To do this, place the cursor on the keyword as before and press Shift+Help. The AmigaGuide manual will be opened at the appropriate page to give more details on the command. Alt+Help in the same position will open a list of other commands in the library containing the current keyword.

AmiBlitz 3 extends this functionality to also cover the standard Include procedure names, and also includes a viewer for the official Autodocs if help is summoned for an OS call, however this requires a native SDK to be installed as the Autodocs themselves aren't distributed with AmiBlitz.

Source Browser

This is a very handy area, normally to the right of the main editor, where Blitz lists all the labels and procedures used in your program. In TED and SuperTED, this is a fixed column to the right of the source area and only shows up when a label is created with a . prefix, for example: .MyLabel In AmiBlitz's PED, this list is a separate window in the same position, but can be resized or rearranged to suit your preferences.

Clicking on one of the listed labels or procedures jumps the source code view directly to that point, allowing you to easily and quickly navigate the different areas of your code. It also acts as a reference for your label names and your procedure parameters, since these are listed along with the procedure name.

Instruction Browser

This window lets you search for any internal commands or procedures from the standard AmiBlitz Includes. Double-clicking the search results will open the AmigaGuide help information for that instruction. This window is only available under AmiBlitz/PED.

Library Browser

This window lists all the Blitz internal libraries available, including their library number. This window is only available under AmiBlitz/PED.

Variable Browser

This window lets you browse all constants, structs (NewTypes) and variables used in or available to your program. This includes any declarations in the Include files and resident files that your program uses. Double-clicking on a struct or a variable of a NewType will list the fields of that struct. Any sub-structs can then be double-clicked to show the fields and so on. Especially useful for finding the correct name of a field in an OS structure. This window is only available under AmiBlitz/PED.