Getting Started: Using the editor

The editor window

The PureBasic editor window is split into four main sections: menu/tool/file bar, the editing area, the procedure browser and the status bar.

The PureBasic editor

The bars at the top of the window give you access to familiar standard functions such as opening, closing and saving files and editing functions such as cut, copy and paste. You can also control the compiler from these menus. The file bar is a set of tabs which allow you to display and choose which file you are currently editing (the editor supports multiple simultaneous files).

The editing area is (by default) on the left side of the window. This is where you edit your source codes.

On the right side of the window is the procedure browser. When you enter special pieces of code known as procedures they will be displayed in the procedure browser, allowing you to quickly navigate your source code. The procedure browser can also be moved to the left side of the window or used as a drop down listbox in the toolbar.

Finally the status bar at the bottom of the window shows you information and statistics about the file you are currently editing, such as line number and character position.

Using the editor

You do not need to know the full abilities of the editor if you want to enter PureBasic code and run it, since you can ignore some of the advanced options for now. As mentioned above, there are a lot of "standard" functions provided in the menu and tool bars, so you will probably already be familiar with those.

The main steps you need to follow to write and run programs written in PureBasic are as follows:

  1. Create a new source file by using the "File menu->New" item or open an existing file using the "File menu->Open" item
  2. Make your edits, additions and deletions by editing the source code in the editing area of the window
  3. Save your source file by using the "File menu->Save" item
  4. Run your program by using the "Compiler menu->Compile/Run" item to test it or use "Compiler menu->Create Executable" to create an application.

Of course, there are some options which you can set for the compiler, although these can be left at their default values for now. If you are required to change them during the course of this User Guide it will be explained in the section which requires the change. The one option which is worth mentioning now is the one which enables or disables the runtime debugger. This can be found in the "Compiler menu->Debugger" item and is ticked if the debugger is enabled. Normally you will want the debugger enabled when you are testing your programs, so make sure that is turned on.

Full instructions on using the editor can be found in the Using the integrated editor section of the main reference manual.