If you mean what I think you mean then it's not particularly easy. I wanted to know how to do this for my xretrace macro so that I could open the xretrace.e module in the editor when the user pressed f1 for help after the module was loaded. In the end I gave up and forced my code to be within a known folder in the config folder. One possible benefit (or confusion) from that is that when you upgrade to a new version of slickedit but still want to run older versions (like I do) you can have separate .ex files for each version.
Anyway, there's a call_list thing for _on_load_module - this means that a function that starts with _on_load_module_abc gets called when module abc gets loaded, just before loading. The problem is, the very first time the module is loaded, the function _on_load_module_abc doesn't yet exist. To get round that you would need to have another module that gets loaded before abc
e.g. module abc1.e
_str my_abc_module_path;
void _on_load_module_abc(_str module_name)
{
my_abc_module_path = module_name;
}
////////////////////////////////////////////////////
and in module abc
#import abc1.e
definit()
{
say(my_abc_module_path);
}
and you can use strip_filename(my_abc_module_path, "N");
to get the path. And you have to ensure that abc1.e is loaded before abc.e.
The above is mostly untested.
Another way you might consider is that #include somefile looks first in the folder containing the file being loaded, so could arrange to have another file in the same folder that contains a text string specifying the path e.g.
file abc_path.txt could have
#define MYPATH c:/temp/mymacros
which would be generated by an installer - or it could be generated by a batch file in the same folder using %0 and was run by the user upon installation.