|
Post by davecheckley on Apr 7, 2021 10:03:21 GMT -5
But THINBASIC works for me???
|
|
|
Post by George on Apr 7, 2021 10:49:15 GMT -5
Dave: Where are you reading about GetShortName, that name is simply the internal name of an SPFLite function. It is not documented anywhere, unless you've downloaded the code and examined the code comments.
Did you mean GetShortPathName, which is an official MS API function.
George
|
|
|
Post by davecheckley on Apr 7, 2021 10:59:05 GMT -5
|
|
|
Post by davecheckley on Apr 7, 2021 11:10:14 GMT -5
Is there any way I can debug the call without buying PowerBasic?
|
|
|
Post by George on Apr 7, 2021 12:10:33 GMT -5
OK, after much experimenting with the PB SHELL function, ShellExecuteEX and all variations of opening the Help (using Assoc setup, invoking HH.EXE directly), trying quotes/no quotes, I now have something that consistently works.
Major problem was in using the -mapid operand of HH.EXE to indicate a starting point for the Help window. It looks like sometimes you can say -mapid 0 to open at the default CHM topic and it works, and sometimes it just doesn't work.
I've no idea why HELP has worked so well for everyone for years and then goes bonkers on Dave's system. Right now I'm chasing it no further.
So what did we end up with:
IF IsEQ(gCmdOps(1), "MACROS") OR IsEQ(gCmdOps(1), "MACRO") THEN' MACROS? lclcmd = "hh.exe " + ENV.EXEPath + "SPFLite Edit Macros.chm"' Build command string retc = SHELL(lclcmd, 1) ' SHELL to it MExitMeth ' Exit END IF '
IF IsEQ(gCmdOps(1), "THINBASIC") OR IsEQ(gCmdOps(1), "BASIC") THEN ' BASIC? lclcmd = "hh.exe " + ENV.EXEPath + "thinBasic.chm" ' Build command string retc = SHELL(lclcmd, 1) ' SHELL to it MExitMeth ' Exit END IF '
mapid = IIF(gCmdNumOps = 1, GetHelpIndex(gCmdOps(1)), 0) ' Get a mapid (or zero) lclcmd = ENV.EXEPath + "SPFLite.chm" ' Build path lclCmd = "hh.exe -mapid " + FORMAT$(mapid) + " " + lclcmd ' Build command string RetC = SHELL(lclCmd, 1) ' SHELL to it
It would be nice to understand why 2 of 3 CHM files worked and not the other one, even more so that the one that failed on my system was not the same one as on Dave's system. As I said, I'm nor pursuing this further.
George
|
|
|
Post by George on Apr 7, 2021 13:50:23 GMT -5
Robert: I hate to disillusion you, but the help for the main SPFLite.CHM file has always been via HH.EXE.
The Help for thinBasic.CHM and SPFLite Edit Macros.CHM were opened via the ASSOC entry.
I can't open the main help file via the ASSOC method because it does not allow for passing a parameter to the Help reader program.
So .. I installed SumatraPDF - great - it handles CHM files, but in a quick trial I don't see what's so special about it. And it doesn't seem to support any command line operands providing a starting topic ID.
So if I go the ASSOC route, all that work in HnD to create logical topic IDs, the tables in SPFLite to map Hnd topic numbers to named topics, will just be turfed out. No saying HELP FIND anymore, or any other HELP topic.
Really?
George
|
|
|
Post by George on Apr 7, 2021 13:54:30 GMT -5
No I did not try quotes. Until I get a way to pass the -mapid # to the reader program it doesn't buy me anything. George
|
|
|
Post by George on Apr 7, 2021 14:21:07 GMT -5
Robert: Here, you play with this and see if you can get the -mapid nnn operand into the program. If it works, the -mapid 103 should start in the Primary FIND command. But still if you want to user YOUR reader, it has to support the mapid somehow.
George
#COMPILE EXE FUNCTION PBMAIN () AS LONG LOCAL lclcmd AS STRING, retc AS LONG
lclcmd = ENVIRON$("COMSPEC") + " /C START " + $DQ + $DQ + " " + $DQ + "C:\Program Files (x86)\SPFLite2\SPFLite.chm" + $DQ + " " + "-mapid 103" retc = SHELL(lclcmd, 1)
END FUNCTION
|
|
|
Post by Stefan on Apr 8, 2021 9:45:16 GMT -5
Other idea.... There's a typo somewhere. I note the original opening post says... "Windows cannot find 'C:\PROGRA~2\SPFLite2\SPFLite'."
The SPFLIte executable is called SPFLite2.EXE
Hope this helps.
|
|
|
Post by George on Apr 8, 2021 9:56:49 GMT -5
Robert: Since Sumatra can't handle a -mapid parameter, trying to figure out the syntax for START and passing program operands is moot.
I spent more time this AM experimenting. No luck. I could not even figure out the syntax for a START command, entered through a CMD window, that worked properly when opening via the ASSOC entry.
I think we're done here.
George
|
|
|
Post by George on Apr 8, 2021 9:57:55 GMT -5
Stefan: The EXE is SPFLIte2. The CHM file is still just SPFLite.
George
|
|
|
Post by davecheckley on Apr 8, 2021 10:54:50 GMT -5
Stefan: Windows can't find "C:\PROGRA~2\SPFLite2\SPFLite Edit Macros.chm" - it is not, for some reason, handling the spaces in the Edit Macros help file. What I (and I think everyone else) don't understand is why my system chokes on spaces when the rest of the world works just fine. And I feel very guilty that George is wasting so much time on a tiny issue...
Cheers, Dave
|
|
|
Post by George on Apr 8, 2021 11:19:19 GMT -5
Dave: Don't sweat it. I was able to duplicate (sort of) your problem, which is always the first step in correcting it.
I can't explain why it was failing, it made no logical sense that it could open A.CHM, B.CHM but not C.CHM. And then for me it worked ok on C.CHM and failed on B.CHM. Totally illogical.
So it became experimentation, and I now have something that works (for me at least) for all 3. Again, not logical that the previous didn't work, but . . . .
I'm going to put out a new Beta version of 2.4 today. I'm not asking you to try it, that's totally your call. But it contains the new HELP code.
George
|
|
|
Post by George on Apr 8, 2021 12:47:21 GMT -5
Well, that's the reason the code was shrinking the names with GetShortPathName, it returns a string without spaces. SPFLite does that in several places simply to avoid the nuisance of double-quoting, double-double-quoting and I've even had to do triple-double-quoting. (Before I gave up and went to GetShortPathName,)
Being honest, the number of times I've retyped 'SPFLite Edit Macros' in the last day or so in trying to find a working solution, I doubt the failures were TAB caused.
Interesting idea nonetheless.
George
|
|
|
Post by George on Apr 8, 2021 14:38:36 GMT -5
Robert: Yeah, spaces are both good and bad, like you I think it's mostly bad. So many things have problems and need quotes to solve it.
George
|
|