There are four ways to extend the SlickEditŪ code editor using Slick-C:
When using macro recording, Slick-C source code is created for a key bindable command. To create a recorded macro, complete the following steps:
From the main menu, select Macro → Record Macro.
Perform the actions that you want the macro to repeat.
When finished, select Macro → Stop Recording.
The macro is saved as Slick-C source code and you can edit the recorded macro through the user interface. Recorded macros are saved in the vusrmacs.e file in the user configuration directory.
A key bindable command is the most common way to extend the editor. Command macros can be bound to keys or invoked from a menu. To create a Slick-CŪ command named hello, complete the following steps:
Place the macro code below into a new file named test.e:
_command void hello()
{
message("Hello World");
}With the file still open, press F12 or use the load command to compile and load the macro. Or, from the main menu, click Macro → Load Module, then browse and select the macro to load.
Now you can type hello in the command line and the message Hello World is displayed.
The hello command can be bound to a key. To bind the hello command to Alt +5 , complete the following steps:
From the main menu, click Window → SlickEdit Preferences → Keyboard → Key Bindings.
In the Search by command combo box, type hello.
Click Add.
Press Alt+5.
Click Bind.
Click OK on the Options dialog.
Now press Alt+5. The message Hello World is displayed.
Slick-CŪ includes a dialog editor that allows you to create event-driven forms using a predefined set of controls.
This section describes:
For more information, see also Creating Dialog Boxes.
To create a simple event-driven dialog box, complete the following steps:
From the main menu, select Macro → New Form.
In the dialog editor Properties dialog box, double-click Insert Button Control.

Double-click Insert Text Cox Control in the dialog editor Properties dialog box.
Move the command button or the text box so that they do not overlap. Click on the object with the left mouse button, hold it, and drag to move the object.

Double-click on the command button that appears on the form (not the bitmap in the dialog editor Properties dialog box). The Select An Event dialog box appears with lbutton_up displayed in the combo box.
Press Enter to select the event.
The Open dialog box is displayed for a new file that is to contain the source code for this dialog box. Type form1.e and press Enter. A file is displayed named form1.e with the following lines of code:
#include "slick.sh"
defeventtab form1;
void ctlcommand1.lbutton_up()
{
}If the previous lines of code are not displayed, then a form1.e file might already exist. If so, modify the existing form1.e file to contain the previous lines of code.
Modify the code to add the following statement: ctltext1.p_text="Hello World";
Example:
#include "slick.sh"
defeventtab form1;
void ctlcommand1.lbutton_up()
{
// Set the p_text property of the text box control
ctltext1.p_text="Hello World";
}From the main menu, select Macro → Load Module.
To load the dialog box, and then display it, complete the following steps:
Right-click on the form and select Load and Run Form.
Click ctlcommand1. Hello World is displayed in the text box.
To close the Form1 dialog box, press Esc.
Type show form1 to display this dialog box from the command line.
To display the dialog box modally, type show -modal form1 on the command line.
The dialog source is saved in the vuserdefs.e file in the user configuration directory, My SlickEdit Config. Press Ctrl+Shift+Space while any dialog box is running to edit it (including the Properties dialog box).
To bind a command to a key that displays a dialog box, use the following example to write the necessary command:
#include "slick.sh"
_command void run_form1()
{
show("-modal form1");
}See Key Bindable Command for more information about binding a command to a key.
Slick-CŪ allows you to write batch macros. Batch macros are macros that can be run, much like shell scripts, from within the editor. They do not need to be loaded, and they do not remain resident in the editor after they have been run.
Use a batch macro when working with Slick-CŪ primitives that you want to share among multiple users. Batch macros cannot be bound to a key; however, you can execute a batch macro from the command line or a menu item.
Open an empty buffer and type the following code:
#include "slick.sh"
void defmain()
{
message("Hello World");
}Save the file as hellow.e, then press Esc to open the SlickEditŪ command line.
Type hellow, and press Enter.
The status line displays the message Hello World is displayed.
Batch programs must be saved before they are executed so that the macro can compile. Also, batch programs are automatically compiled if there is no corresponding .ex file, or if the date of the source file is newer than the date of the .ex file.