Blitz2D Newbies: UltraBlitz: Using UltraEdit with Blitz Basic
by Ghost Dancer

Blitz maybe a great language, but the IDE could be better. Fortunatley, the Blitz compiler can used from within other text editors. I have been using UltraEdit (available from www.ultraedit.com) for many years now both at work and at home – it is a great all round editor for just about any programming language.

This tutorial will expalin how to set up syntax highlighting and compiling from within UltraEdit and will work with Blitz Basic, Blitz Plus and Blitz 3D.

Step 1. System Variables

The first thing to do is set up some system variables. We are going to add a variable called “blitzpath”, and then add to the existing variable called “path”.

To do this, right-click on your “My Computer” icon and click “Properties”. Click the “Advanced” tab, then the “Environment Variables” button. You should get a window that looks something like this:

Under the system variables part, click the “New” button and create a variable with the name blitzpath, and the value will be the path of your Blitz directory (e.g. C:\Progra~1\Blitz3D):

Please note, that if your Blitz directory is in “Program Files”, you will need to use “Progra~1” (without the quotes) instead of “Program Files” when entering the value. In the list of system variables, there should already be one called “Path”. We are going to add to the existing value of this variable (so don’t delete anything!). Scroll down the list and select it, then click the “Edit” button. In the value field add a ; character at the end of the text that is aleady there, followed by the path to the “bin” directory in your Blitz Basic directory (e.g. “;C:\Progra~1\Blitz3D\bin”):

OK, now these have been set up, you will need to restart your computer for the new variables to take effect…

Step 2. Tool Configuration in UltraEdit

We are now going to set up 3 tools – one to compile and run your Blitz program, one to run in degub mode, and a final tool to create an executable.

Creating The Tools

In UltraEdit, click the “Advanced” menu and select “Tool Configuration…”. Enter the following information:

Command Line: blitzcc.exe "%f"
Menu Item Name: BlitzCompile

Then make the selections as indicated in the image below and click the “Insert” button:

The debug tool is very similar to this, but use the following information:

Command Line: blitzcc.exe -d "%f"
Menu Item Name: BlitzCompile w/Debugger

Then make the selections as indicated in the image below and click the “Insert” button:

Finally enter information for the create executable tool:

Command Line: blitzcc.exe -o "%p%n".exe "%f"
Menu Item Name: BlitzCompile Executable

Then make the selections as indicated in the image below and click the “Insert” button:

Adding Icons

You can download some icons from my website (see below) Save the icon files included in this download (e.g. in you’re “My Documents” folder). In the UltraEdit tool configuration window, double-click a tool name to select it and click the “Advanced” button. Use the “Browse” button to select the icon file and click “OK”.

Repeat this for the other tools you created.

Adding Your Buttons To The Toolbar

Adding your new Blitz tools to the toolbar is easy. Right-click the toolbar to get the customise window and expand the “Advanced” options in the tree view. Your tools should be called “Tool 1”, “Tool 2” and “Tool 3” (unless you have already added your own custom tools):

Then, simply drag and drop your tools from this window onto the toolbar.

Key Mapping

In the “Advanced” menu, select the “Configuration…” option, then select the “Key Mapping” tab. Scroll down the list of commands until you see “AdvancedUserTool1”, “AdvancedUserTool2” and “AdvancedUserTool3”. To assign a key stroke, select the tool, then click in the “Press New Key” box, then press the key you want to use. It will show you if that key is already assigned to something else. If you are happy with your key mapping, click the “Assign” button:

Your key stroke will then appear in the “Existing Keys” list as shown above. Repeat this process for the other tools you created. I use F5, F6, & F7 for my Blitz key strokes.

Step 3. Syntax Highlighting

Updating The Word File

UltraEdit’s word file contains command lists for various languages so UltraEdit knows which words to highlight. We need to add the Blitz command set to this file. In the UltraEdit configuration window, select the “Syntax Highlghting” tab.

Near the bottom of this window will be the path to your word file. Click the “Open” button to edit the file in UltraEdit.

Add the following:


to the top of your word file and save it. The included file has all the Blitz 3D commands (but not Blitz Plus, sorry). To get a complete list of commands of your current version of Blitz, open a DOS window (“Start Menu” -> “Programs” -> “Accessories” -> “Command Prompt”) and enter the following command and press return:
blitzcc –k > c:\blitz.txt

This will create a text file on your C: drive with a list of all the words. You can copy and paste these into your word file (overwriting the existing Blitz commands). Please note that UltraEdit requries these in alphabetical order so you will need to do this yourself.

Setting The Syntax Colours

Once your word file is set up, return to the “Syntax Highlighting” tab in the configuration window and select “Blitz 3D” (or whatever you called it in your word file) and make sure you have “Enable Syntax Colouring” box ticked.

You can then select each colour group and assign your colours. I use the following set up (colours listed using r,g,b format):


Removing The Yellow Highlighted Line

This is not strictly related to UltraBlitz, but many people ask how to get rid of the yellow background that appears on the current line you are editing. To do this, go to the “View” menu and select “Set Colours…”, then untick the “Enable Actie Line Colouring” option.

That’s it, you should now be ready to start coding…

This article (and icon files) can also be downloaded from my site: www.aurora-soft.co.uk

Notes, Credits & Disclaimer

I have put this tutorial together from information on the old Dark Unicorn Productions website (which sadly does not exist anymore) and my own experiences in getting it all to work. Please note that I am not trying to take credit for other peoples work, I am just making this information available to anyone who wish to use this.

The icons I have made available for download were those that were freely available on the Dark Unicorn Productions – hopefully this is not a problem, but if it is, please contact me and I can remove them.


For a printable copy of this article, please click HERE.


This site is Copyright© 2000-2004, BlitzCoder. All rights reserved.