Colleagues,
by convention, relative paths in BB are evaluated with respect to the BB working directory, thus 'Hr/Demo' stands for 'C:\Program Files\BlackBox\Hr\Demo'.
It seems, however, that Dialog.RunExternal does not fully respect this convention.
When BB is started with the '/USE C:\Herschel' option, the working directory (in terms of BB and Files module) is altered to be C:\Herschel. But Dialog.RunExternal('Hr/Demo/Elf/M.exe') brings up a host dialog box that says Hr/Demo/Elf/M.exe cannot be found. The file is actually found in C:\Herschel\Hr\Demo\Elf\M.exe, but obviously the relative path is evaluated with respect to C:\Program Files\BlackBox, as directed by the .lnk file.
I've looked around, and C:\Herschel (the /USE option) is kept in HostFiles.dir.startup.path: HostFiles.Locator. However it is not available to the programmer: both HostFiles.dir and it's type HostFiles.Directory are not exported.
I can't find a way to figure out the actual working directory of running BlackBox (as directed by the /USE commandline option). Is there one? If I could, I would've used it in calling Dialog.RunExternal.
However, i think that'd be a workaround; a better thing to do, rather, is to make Dialog.RunExternal follow the BB convention and start the passed command in the actual BB working directory.
What do you think? How would such amendment of Dialog.RunExternal affect existing software?