SlickEdit Community
SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: flethuseo on April 30, 2015, 11:01:41 PM
-
Hi all,
I want to create the following macro with an already existing function,
but it cannot find it; I get this error:
Procedure associated_file_exists not found.
#include "slick.sh"
_command void edit_associated_ruby()
{
_str filename = strip_filename(p_buf_name, 'N');
// extract the extension
_str extension = _get_extension(filename);
filename = _strip_filename(filename, 'E');
if (!associated_file_exists(filename, "xml", returnAll)) {
filename = "";
}
// edit the file
if (file_exists(filename)) {
edit(maybe_quote_filename(filename),EDIT_DEFAULT_FLAGS);
message("Found: " filename);
} else {
message("No match found");
}
}
I tried including stdcmds.e but I get another error.
-
The function is static so you can't call it. Just copy the entire function out of stdcmds.e into your own file and rename it my_associated_file_exists or something.
-
Hmm I didn't want to do that. If I do that, I have to copy a bunch of other static functions that are called by that very function.
-
Did you actually try it? I tried it before my last post and it compiled fine without copying any other static functions.