0 votes
by dave selby (250 points)

Hello

So just starting out with VFX Forth and there is a lot to like but I noticed that the help function is broken. 

help help

%LOAD_PATH%/../doc/VfxLin.vix

Cannot open HELP index file

 -> help help

I tried setting up HelpBase$ to the correct string as per the manual but still failure, so I got to digging around in the source code, and learning some more forth while I was at it.

The first problem was with pattern matching, that extra space needs to be removed else the code will never match an index.

209c209

<   ", \entry{\code {"

---

>   ", \entry {\code {"

The second was that there was a missing check for _x64 target for the code to save and load config from the .INI file, so nothing was saved.

397a398

> [defined] Target_x64_Linux or

Next %LOAD_PATH% is used to help locate where the help files are, but %LOAD_PATH% is set to the path of the executable that is running, so if you do a scripted install it is at /usr/local/bin, thats a long way from /home/xxx/VfxForth/Doc/ ? It works better if you start VfxForth directly from its /VfxForth/Bin dir but by default its software linked to /usr/local/bin.

I changed from %LOAD_PATH% to %BASEPATH% that points directly to the /home/xxx/VfxForth dir then modified the rest of the path.

192c192

<   s" %LOAD_PATH%/../doc/VfxLin" HelpBase$ place

---

>   s" %BASEPATH%/Doc/VfxLin64" HelpBase$ place

Lastly I changed the default address to point to “~/VfxForth/Doc/VfxLin” which is perhaps a better option than “/usr/share/doc/VfxForth/Doc/VfxLin” ?

404c405

<   s" HelpBase" HelpBase$ /Help$ s" /usr/share/doc/VfxForth/Doc/VfxLin" Ini.ReadStr

---

>   s" HelpBase" HelpBase$ /Help$ s" ~/VfxForth/Doc/VfxLin" Ini.ReadStr

Having made these changes, and then executing …

include /home/dave/VfxForth64Lin/Lib/PDFhelp.fth

Help works out of the box :) … only problem is it does not survive restarts, thinking the library files are compiled into the kernel and as such will have to recompile the kernel to keep the modified PDFhelp.fth ? 

I have not managed to do this yet.

So I hope this is useful, thanks once again for an excellent Forth from a relative Forth beginner  :)

1 Answer

0 votes
by dave selby (250 points)

Apologies, I made some errors above, if you want "help" to work the following is far more robust

From a Fresh install, check ~/.VfxForth/VfxForth.ini basepath is configured, in my case…

basepath = /home/dave/VfxForth64Lin

Next get the patch ...

diff -r /home/dave/VfxForth64Lin.VIRGIN/Lib/PDFhelp.fth /home/dave/VfxForth64Lin/Lib/PDFhelp.fth

192c192

<   s" %LOAD_PATH%/../doc/VfxLin" HelpBase$ place

---

>   s" %BASEPATH%/Doc/VfxLin64" HelpBase$ place

209c209

<   ", \entry {\code {"

---

>   ", \entry{\code {"

219a220,221

>   \ expand macros to get path to VfxLin64.*

>   helpbase$ $ExpandMacros count helpbase$ place

397a400

> [defined] Target_x64_Linux or

404c407

<   s" HelpBase" HelpBase$ /Help$ s" /usr/share/doc/VfxForth/Doc/VfxLin" Ini.ReadStr

---

>   s" HelpBase" HelpBase$ /Help$ s" %BASEPATH%/Doc/VfxLin64" Ini.ReadStr

Then use the above patch and apply it to the PDFhelp.fth file, in my case

patch /home/dave/VfxForth64Lin/Lib/PDFhelp.fth /home/dave/Desktop/PDFhelp.fth.PATCH

Then in VfxForth include the file, in my case

include /home/dave/VfxForth64Lin/Lib/PDFhelp.fth

Then this works :)

help help

Now working on howto recompile VfxForth so its included automatically without having to re-include it

...