Configuring Application Help
Overview
CCLAS EL functional help is provided in HTML5 format, however, because the default help format is CHM (which is now obsoleted), custom logic must be put into the HelpUDF.vbs script file that is located in the Config folder, to access HTML5 help.
Process
The custom HelpUDF.vbs file, located in the Config folder, that is supplied with the CCLAS EL installation, contains the logic to locate and display the CCLAS EL HTML5 help content in a web browser.
Where the HelpUDF.vbs script file is not located in the Config folder, then CCLAS EL attempts to find help configured by the HelpDirectory and HelpFileGLOBALSETTINGS for CCLASMGR in CHM format, however, this format is no longer supported.

'* ************************************************************************
'* UNIT/MODULE NAME : HelpUDF.VBS
'*
'* DESCRIPTION:
'* Script containing method to allow own help to be
'* displayed from script.
'*
'* INTERFACE:
'*
'* DEPENDENCIES:
'*
'* CHANGE CONTROL HISTORY:
'*
'* DATE WHO SPR # DESCRIPTION OF CHANGE
'* 05052006 TD 0000001580 Initial version of code.
'* 03112021 TD Added code to use html5 help files
'* ************************************************************************
Option Explicit
Sub ScriptShowHelp(oParams)
'* ************************************************************************
'* UNIT NAME:
'* HelpUDF.ScriptShowHelp
'*
'* DESCRIPTION:
'* Procedure to display User defined help.
'*
'* INPUT PARAMETERS:
'* oParams: Collection of parameters passed into method.
'*
'* OUTPUT PARAMETERS:
'* None
'*
'* RETURN VALUES:
'* None
'*
'* SIDE EFFECTS:
'* None
'*
'* NOTES:
'* oParams is a dictionary object containing different
'* useful pieces of information.
'*
'* Items are accessed using a key: oParams(Key).
'* Items can be edited: oParams(Key) = Value
'*
'* The items in this collection are as follows:
'* HelpFile : Name of help file to use.
'* ProgramCode : Programcode for program that called this method.
'* CurrentForm : Name of active form when help triggered.
'* HelpOverride: Flag to use current help method or not after this completes.
'* ControlHelp : Flag to use help to the control level or not.
'* HelpContext : Default help context to use if there is not help context.
'* HWND : Default handle of form to use if no active form.
'* ************************************************************************
' These methods were used to check values of parameters collection
LogToMsgBox(oParams)
'LogToFile(oParams)
dim sURL
sURL = HelpURL(oParams("ProgramCode"), oParams("CurrentForm"), clsSecurity)
oParams("HelpOverride") = ShowHelp(sURL)
End Sub
Function HelpURL(byval sProgramCode, byval sFormName, oSecurity)
dim sHelpDirectory
dim sPage
dim sUrl
sHelpDirectory = oSecurity.GlobalSetting("HelpDirectory")
sPage = sProgramCode & "-" & Replace(sFormName,"frm","") & ".htm"
If (instr(sHelpDirectory, "file://") = 0) Then
sUrl = AddChar(sHelpDirectory, "\") & "CCLAS-EL-Online-Help-HTML5\Screens-CCLAS-2\" & sProgramCode & "\" & sPage
Else
sUrl = AddChar(sHelpDirectory, "/") & "CCLAS-EL-Online-Help-HTML5/Screens-CCLAS-2/" & sProgramCode & "/" & sPage
End If
HelpURL = sUrl
End Function
Function AddChar(byval sPath, byval sChar)
If Right(sPath, len(sChar)) = sChar Then
AddChar = sPath
Else
AddChar = sPath & sChar
End If
End Function
Function ShowHelp(byval sUrl)
Dim wshShell
Set wshShell = CreateObject("WScript.Shell")
on error resume next
If (instr(sUrl, "file://") = 0) Then
wshShell.Run chr(34) & sUrl & chr(34) ' When using c:\....
Else
wshShell.Run sUrl ' When using file:///c:/....
End If
ShowHelp = (Err.Number = 0)
if (not ShowHelp) then
'msgbox cstr(err.number) & ": " & err.description
end if
End Function
Sub LogToMsgBox(oParams)
Dim s
Dim l
Dim aKeys
Dim aItems
aKeys=oParams.Keys
aItems=oParams.Items
For l=1 to oParams.Count
s = s & aKeys(l-1) & ": " & aItems(l-1) & vbCrLf
Next
'MsgBox s
s = "HelpFile: " & oParams("HelpFile") & vbCrLf
s = s & "ProgramCode: " & oParams("ProgramCode") & vbCrLf
s = s & "CurrentForm: " & oParams("CurrentForm") & vbCrLf
s = s & "HelpOverride: " & oParams("HelpOverride") & vbCrLf
s = s & "ControlHelp: " & oParams("ControlHelp") & vbCrLf
s = s & "HelpContext: " & oParams("HelpContext") & vbCrLf
s = s & "HWND: " & oParams("HWND")
MsgBox s
End Sub
Sub LogToFile(oParams)
Dim sOutput
Dim sDesc
sOutput = "HelpFile, " & oParams("HelpFile") & ","
sOutput = sOutput & "ProgramCode, " & oParams("ProgramCode") & ","
sOutput = sOutput & "CurrentForm, " & oParams("CurrentForm") & ","
sOutput = sOutput & "HelpOverride, " & oParams("HelpOverride") & ","
sOutput = sOutput & "ControlHelp, " & oParams("ControlHelp") & ","
sOutput = sOutput & "HelpContext, " & oParams("HelpContext") & ","
sOutput = sOutput & "HWND, " & oParams("HWND")
' Prompt for description that can be logged to a log file.
'sDesc = InputBox ("Form-" & oParams("CurrentForm") & " Id="& oParams("HelpContext"), "Form description", "")
'FileAppend clsSecurity.GlobalSetting("BinDirectory") & "\Form-Identifications.CSV", "Form, " & sDesc & "," & sOutput & vbCrLf
End Sub
'-----------------------------------------------------------------------------------
' Generic File Append
'-----------------------------------------------------------------------------------
Sub FileAppend (byval sFile, byval sString)
Dim oSupport
On Error Resume Next
Set oSupport = CreateObject("CCSUPP01.clsSupport")
If sFile <> "" Then
oSupport.AppendFile sFile, sString
End If
Set oSupport = Nothing
End Sub
'-----------------------------------------------------------------------------------
' Generic File Save
'-----------------------------------------------------------------------------------
Sub FileSave(ByVal sFile, ByVal sString)
Dim oSupport
On Error Resume Next
Set oSupport = CreateObject("CCSUPP01.clsSupport")
oSupport.SaveFile sFile, sString
Set oSupport = Nothing
HandleError
End Sub