wwHelpEvents::BeforeImportCodeMethod

This event fires prior to a class method getting imported into Help Builder when running the Visual FoxPro PRG Class Import Wizard.

This code is called after the topic has been created, but before any of the values are set with the exception of the Topic name, HelpId and basic SeeAlso value that references back to the class. The PK and ParentPk are also set prior to this event firing.

All properties may be overridden except the PK and ParentPK properties, unless you set the ParentPK to a valid existing value.

Your method receives the entire code snippet as input, so you can parse the various Help properties from your snippet code or comment blocks on your own. Your code should then set the properties of the oTopic object passed in as a parameter.

Once set you can return from the method call by returning a numeric value to either stop processing this method, continue on and fill any non-empty values from the Class properties or force everything to be overwritten.

o.BeforeImportCodeMethod(lcSnippet, oTopic)

Return Value

numeric 0 - don't process this method any further 1 - update any empty properties from the class properties 2 - update all properties from the class properties


Parameters

lcSnippet
Full method snippet of the method being processed. If the method contains a comment block of your own formatting you can parse this comment block and set the oTopic properties to populate the relevant fields.

oTopic
This object contains the various help topic properties for the help topic. Set these properties from the parsed values you retrieved.

Note

You can mix parsed parameters and class description/values by returning 1 from this method call.*

Example

*** This example demonstrates how Help Builder
*** parses by default using the CommentBlock object
PARAMETER lcSnippet, loTopic, lnUpdateMode

IF VARTYPE(lnUpdateMode) # "N"
  lnUpdatemode = 1  && Update only empty topics
ENDIF

IF VARTYPE(THIS.oHandler)="O"
   PRIVATE poHandler
   poHandler = THIS.oHandler
   lnValue = goEval.EVALUATE([poHandler.BeforeImportCodeMethod(lcSnippet,loTopic)])
   IF !goEval.lError
      *** Call succeeded
      RETURN lnValue
   ENDIF
ENDIF

*** Help Builder Comment Block Parser Object
loCB = CREATE("CommentBlock")

IF loCB.Parse(lcSnippet,loTopic)
   *** Update only empty topic fields
   RETURN 1
ENDIF

*** Update everything from class definition
RETURN lnUpdateMode


*** Note that if you manually parse (see BeforeImportClassMethod
*** you have to set the oTopic members to the various values

See also:

Class wwHelpEvents

© West Wind Techologies, 2018 • Updated: 08/11/15
Comment or report problem with topic