Subject Re: Help f1 problem Solutiom
From Mervyn Bick <invalid@invalid.invalid>
Date Wed, 11 Sep 2024 08:51:01 +0200
Newsgroups dbase.getting-started

On 2024/09/10 15:46, Akshat Kapoor wrote:

> Sorry for missing this. runhidden() can accept 2 parameters. The first
> is command and the second is batch file name. So you need not hard code
> the path.

The second parameter for runhidden() for the BAT file name is optional.
If it is not supplied runhidden() uses junk.bat as the default.  The
.bat file can't be written to C:\Program Files (x86) or its subfolders
so, as the .bat file and the .chm file will be in different folders, the
path to the .chm file must be provided.

openURL() from miscapi.prg in the dUFLP is a far better option for
opening the .chm file as it doesn't involve creating a .bat file each
time the user needs to open the help file.

If Charlie really wants to use runhidden() instead of openURL() it can
be done but Charlie's code needs to be modified slightly.

Ignoring possible typos, Charlie used

runhidden("c:\program files (x86)\chacha\help\chacha.chm")  which passes
c:\program files (x86)\chacha\help\chacha.chm to Windows.  Windows can't
deal with the spaces so it won't work.

If Charlie had used
runhidden(["c:\program files (x86)\chacha\help\chacha.chm"]) Windows
would see "c:\program files (x86)\chacha\help\chacha.chm" which it can
deal with.

Mervyn.