HTML Help Builder
Link name from form?
Gravatar is a globally recognized avatar based on your email address. Link name from form?
  Michael Hogan (Ideate Hosting)
  All
  Mar 23, 2018 @ 10:27am

I'd like to be able to automate links from my VFP forms to their associated help page in HTML Help Builder. Is there a way to use the form name, scx name, or form ID to link to the help page for a particular form in my VFP application?

Just to be clear - I want to link to html pages - not a CHM file.

Gravatar is a globally recognized avatar based on your email address. re: Link name from form?
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Mar 26, 2018 @ 02:46am

Not quite sure what you're asking.

I do this in a few of my applications and I just reference the topic ID directly. I suppose you can add a table to your app to do a look up based on active form, active field, active whatever and map that to a topic id.

You can also reference topics by:

  • Topic Id + .htm
  • using ?topic=Topic Name query string

For example:

https://west-wind.com/webconnection/docs/_s9001zx3r.htm

and

https://west-wind.com/webconnection/docs?topic=West Wind Internet Protocols

Go to the same place.

More info here:

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Link name from form?
  Michael Hogan (Ideate Hosting)
  Rick Strahl
  Mar 29, 2018 @ 09:57am

Maybe you have a different way of doing this, but what I'm looking for is a somewhat automatic way to associate a form or object with a help page, and have a blank help page created for each form in a somewhat automated way in order to quickly start a new help builder project.

Your docs say you use the TopicID - I assume this is the HelpContextID which is 0 for all my forms and objects. If that's true, I can assign the HelpContextID for all my forms either randomly or by using the HWnd to hash together a string - by hacking the scx files.

I'd ideally like pointing HelpBuilder to a project and having it assign a value to maybe the HelpContextID of every form while creating a blank help template page for each one.

So I might have an object on my form that called the help page as:

[https://myapp.com/docs/] + HelpContextID + [.htm]

I hope I'm making sense.

Gravatar is a globally recognized avatar based on your email address. re: Link name from form?
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Mar 29, 2018 @ 02:09pm

The HelpContextId is what FoxPro and any other CHM based platform uses for CHM file lookups. That ID is a numeric value and Help Builder stores that value as an autogenerated ID. That's not the same as the topic ID which is a SYS(2015) generated ID.

Like I said the best way to do this is to have a lookup that can pick up the help context id that FoxPro holds and map it to a topic ID which you can then easily embed into a URL.

HelpBuilder's project file is a DBF so it's easy to generate a lookup table or if the hb project file is available you can use that table directly to do the lookup.

I don't remember offhand whether you can intercept the help request and capture the helpcontext id or not in FoxPro forms but there are routines you can use to capture the active Context id in wwhelp_keys.prg. For example, Alt-F1 in that captures the context id and then opens Help Builder with that topic activated. You can do the same (after context id-> topic translation) with topics.

Eh - scratch that code in wwhelp_keys.prg - that works inside of the editor. It's actually easier inside of a running application - you can map to the active form control directly, and then walk up the tree until you find a Help Context Id.

As to adding topics programmatically - you can use the COM interface (or Fox for that matter) or simply dump data into the .hbp file.

+++ Rick ---

© 1996-2024