A command or procedure can be called as a method without any additional declaration data. The sample Slick-CŪ source below is an example of this feature.
#include "slick.sh"
defmain()
{
// Call the tbupcase function as a method to operate on the SlickEdit
// command line. _cmdline is a constant instance handle defined in slick.sh.
_cmdline.tbupcase();
}
// This function uppercases the text in a text box or combo box input field
// and has been written to operate on the current object.
void tbupcase()
{
// The p_text property is used to get and set the contents of a text box
// or combo box input field.
p_text=upcase(p_text);
}The tbupcase is not defined to be a method of a particular class. This feature permits macros written in SlickEditŪ text mode to be converted into SlickEdit macros and used as methods. Also, most functions are written to operate on the current object, meaning you have access to many methods. Using functions as methods is useful when writing dialog box event handlers. If a function is called and a statement within the function is not valid for the current object, the macro is stopped, and a dialog box is displayed indicating the error. The find_error command (Macro → Find Slick-C Error) can then be used to locate the source of the error.