|
 |
Online Resources |
 |
 |
Libraries |
 |
|
 |
 |
Using of the integrated editor |
 |
 |
Overview

The PureBasic editor has been created for the PureBasic programming language and has
many features specially designed for it. It will become more and more powerful and
will support advanced editing like word filling etc. A Visual Designer is already available.
Basic usage:
The PureBasic editor accepts any standard ASCII characters, and loads and saves files
in the ASCII format. It uses all the standard Windows shortcuts to edit the text:
Arrow Keys : Move the cursor in the four directions
Shift + Arrow Keys : Select the text
Ctrl + Home : Go to the top of the source file
Ctrl + End : Go to the bottom of the source file
The most important menu shortcuts are:
Ctrl + S: Save the current source code without any requester
Ctrl + O: Load a new source code
F1: Bring up the PureBasic manual online help (this document). If F1 is pressed on a PureBasic or an API keyword, it will go directly to the keyword definition.
F5: Start the compilation and launch the program
A toolbar provides fast mouse access to these common functions (load, save, cut, copy, paste, undo).
The editor has an auto-indent function which always keeps the cursor in the currently indented block,
providing easy source code editing.
Multiple source files can be edited at the same time in the same editor window.
Each source file has its own tab at the top of the editing area. Clicking on one
of those will show that source file.
There is also a "procedure browser" area in the editor window (the long, thin area
- either on the left or right of the window). This displays a list of the procedures
in your current source file which you can click on to quickly jump to that procedure.
You can also add lines to your source code which start with the symbols ;-
and they too will appear in the procedure browser.
Detailed Usage
The File menu provides access to the standard items for loading, saving and closing your
source files, exiting the editor, etc. There is also a Preferences item which controls
the operation of the editor. There are many options for the editor, described here:
General tab

Source directory: This sets the default directory that the PureBasic editor will
show in file requesters. You can either type the directory into the string gadget
or use the "..." gadget to select a directory from a directory view.
Language: Selects the language used for the editor (affecting menus, editor windows,
requesters, etc). Select one of the available languages from the drop down list.
Coloring: The checkbox enables or disables syntax highlighting - this is the process of
drawing certain parts of source code in different colours to increase readability.
Select the part of the source code from the drop down box and then choose its colour
by clicking on the "..." gadget.
Editor font: Chooses the font that is used to display and edit your source codes in.
Auto reload last project at start: If this is ticked then the PureBasic editor will automatically
load whatever sources files were open the last time you exited it.
Save source before Compile/Run: When this option is ticked the editor will automatically save
all open source files before compiling the program (when you choose to Compile/Run your program -
see Compiler menu below). This can be useful to save you some time manually saving your source
files and means you will also not forget to do so :)
Memorize window position at end: If this option is ticked the PureBasic window position and
size will be saved so that it opens in the same place next time you run it.
Run one instance only: This option controls whether the PureBasic editor will only run once
(and therefore there will only ever be one editor window displayed), or whether running
the editor program again starts another copy of the editor.
TAB length: Sets the number of spaces that a tab character will show as in the editor.
Procedure browser tab

ComboBox in toolbar: This is part of a mutually exclusive setting (along with the next one)
which controls how the procedure browser part of the editor works. If this option is set,
the function browser will take the form of a ComboBox gadget in the toolbar, allowing you
to select a procedure to jump to from a drop down list.
Listbox on side: This is the alternative option for the location of the procedure browser.
Selecting this option makes the procedure browser appear in the main area of the
editor window instead of the toolbar. It also enables the following three options, which
can be used to customise the listbox somewhat.
Left / Right: This drop down list allows you to choose what side of the window the
function browser listbox appears on.
Browser colours: Similar to the syntax highlighting this allows you to customise the colours
of items shown in the procedure browser listbox. Select the item you want to choose the colour
for in the drop down list and then choose the colour using the "..." gadget.
Browser font: Sets the font to be used for the items in the procedure browser listbox.
Sort in alphabetical order: This option applies to both methods of procedure browser.
If ticked, the items in the procedure browser will be sorted alphabetically. If not ticked,
they will be displayed in the order they were found in your source code.
Group markers together: This option is only available if the Sort option above is disabled,
and also affects both methods of displaying the procedure browser. If there are any comment
lines directly above procedures, then these lines will also be shown in the procedure browser.
Always available gadgets
Save: Saves the current state of the options.
Use: Uses the current state of the options for this session only
(until you exit the editor) but does not save them so the preferences will
go back to their previously saved state the next time you run the editor.
Cancel: Exits the preferences window and goes back to the previous set of the options.
The Edit menu contains the standard OS editing functions (cut, copy, paste, goto line, search, replace, etc).
The Compiler menu allows you to control the PureBasic compiler. The items in the menu are:
Compile/Run: Compiles the currently displayed source code and runs it.
Run: Runs the program last created using the Compile/Run menu item.
Debugger: Switch which toggles the runtime debugger on and off.
Options: Controls specific options for the compiler.

Use icon: An icon will be added to the created executable. The icon name is shown in the
read only string gadget and is selected with the "..." gadget.
Enable Inline ASM: Allows the use of ASM keywords directly in the source code.
Be cautious as a variable cannot have the same name as an x86 keyword (MOV, TST, JMP etc...).
NT4 compliant executable: Allows a multimedia application or game (using DirectX) to run without
trouble on NT4. In this case, DirectX 3 is used instead of DirectX 7
(Service Pack 3 is required on the NT4 machine though).
Enable XP skin support: By ticking this option the GUI parts of your program will
support WindowsXP's skinning abilities.
Executable format: The format of the executable created by the compiler is
selected with this drop down list. Possible options are Windows (a "standard" program),
Console (runs only in a console window) and Shared DLL.
Command line: This string gadget enables you to specify optional command line options to
your executables when you use the Compile/Run and Run menu items. Your program should
use something like the ProgramParameter command to retrieve these command line options.
OK: Uses the current compiler settings for the source code.
Cancel: Discards the current compiler settings and goes back to what they previously were.
Create Executable: Create a final executable, including the icon if necessary.
The runtime debugger is never included in the final executable, no matter what
the state of the "Debugger" menu item is.
The Tools menu contains useful tools and programs that you might want to run from the editor.
These are completely configurable using the Config Tools... menu item, as shown below.
There are also three standard tools which are always available:
ASCII table: This tool shows the ASCII character set and their corresponding numerical value
(either in decimal or hexadecimal).
Structure viewer: This useful tool allows you to display the contents of structures
in your source files and the OS resident file. The main list shows the structure
name or the field name, clicking on an item will take you inside that structure.
The Parent gadget goes back to the parent structure (if you clicked into a field with a structure).
The string gadget allows you to type the name of a structure directly (case insensitive).
The Stay on top option chooses whether the structure viewer window will always be displayed on top
of all other windows or not.
Pick colour: A small tool which allows you to get the RGB values of a specific colour.
At the top of the window are some options to control whether the colour picker window
should stay above all other windows, whether numbers should be shown in hexadecimal or
decimal and whether the window should close after you click on one of the insert gadgets.
There is a coloured box allowing you to choose from the entire colour spectrum and a slider to
adjust the brightness of the colour. There are also three trackbar gadgets so you can directly
set the R,G and B values. The colour is displayed in a box on the bottom right of the window.
The gadgets Insert colour and Insert RGB paste the selected colour into your source code in different styles.
Config Tools...: As mentioned above, this item allows you to configure which tools appear in this menu.
this process is described below.
Command Line: This is where you specify the program you want to run from the menu item.
You must enter the path and name of an executable file in the string gadget, or choose
it using the requester which is shown when you click on the Browse button.
Arguments: You can specify the command line arguments for the program in this string gadget.
There are three special options which allow you to have arguments which are related to the
source file you are working on. %PATH adds the path to the current source file to the command
line string. %FILE adds the full path and filename of the current source file to the command line
arguments. %TEMPFILE generates a temporary filename which can added to the command line arguments.
Working Directory: Enter the current directory to use when running the program into the string gadget.
You can also choose the directory from a requester if you click on the Browse button on the right
side of the string gadget.
Menu Item Name: This is the name that will be shown in the Tools menu for this tool
Shortcut: Allows you to set a keyboard shortcut for this tool (from the drop down list) so you
can press that key combination to run the tool, rather than use the menu every time.
"None" means there will be no keyboard shortcut for this tool.
Options: These control how the tool is run.
Run Hidden: If this option is checked the program is ran in the background.
Wait Until Tool Quits: If this option is checked then the PureBasic editor will be
disbaled until the program has completed its work.
Reload source: This option is enabled if you use %FILE or %TEMPFILE in the Arguments gadget
and have checked the Wait Until Tool Quits option. If this option is checked then the current
source file is reloaded into the editor. The two radio buttons below this checkbox control
whether the source is reloaded into a new editor window or into the current editor window.
This option may be useful if your tool modifies the source code in some way.
Hide Editor: This option is enabled if you have checked the Wait Until Tool Quits option. When checked,
the PureBasic editor will minimize itself when the program is running.
Add: Clicking on this button will add the tool (as it is configured in the top section of the window)
to the end of the list of tools.
Insert: Clicking on this button will insert the tool (as it is configured in the top section of the window)
to the list of tools at the currently selected position.
Replace: Clicking on this button will replace the currently selected tool (in the list of tools)
with the one configured in the top section of the window.
Menu Entries: This shows a list of all the configured tools. Double clicking on an entry here
will copy the information for that tool item to the configuration section at the top of the window.
Delete: Clicking on this button will delete the currently selected item in the list of tools.
You will be asked to confirm that you really want to delete the entry.
Up: Clicking on this button will move the currently selected item up one position in the list of tools.
This can be used to change the order of the tools that are shown in the menu in the editor.
Down: Clicking on this button will move the currently selected item down one position in the list of tools.
This can be used to change the order of the tools that are shown in the menu in the editor.
OK: By clicking on this button you accept all changes that have been made to the list of tools and return to the editor.
Cancel: By clicking on this button you discard all changes that have been made to the list of tools and return to the editor.
The Help menu allows you to get help on the editor and the PureBasic language. The Help option
in the menu will display this document (and if the cursor is over a PureBasic or OS command then
the help for that command will be shown).
The About item in this menu gives you some information about the PureBasic compiler and
editor (such as version numbers and copyrights).
|
|
 |
|
|