GetVBScriptCalcRules

Returns the rules that have been loaded into an application. The rules are returned as an array of bytes.

Note:

This method returns the contents of the rules file (.RLE file) that has been loaded into an application. If the rules file was changed after the file was loaded, the updated file’s contents are not returned by GetVBScriptCalcRules.

Syntax

<HsvSystemInfo>.GetVBScriptCalcRules pvarabRules, pbRulesExist

Argument

Description

pvarabRules

Variant array. Returns the application’s rules. The array is returned as a Byte subtype.

pbRulesExist

Boolean. Returns TRUE if a rules file has been loaded into the application, FALSE if no rules file has been loaded.

Example

The following example outputs an application’s rules to a text file. The array of bytes returned by GetVBScriptCalcRules is converted to a String and inserted into a file with various Visual Basic methods.

Dim cSysInfo As HsvSystemInfo, vaRules As Variant
Dim bRulesExist As Boolean, iFile As Integer
'm_cHsvSession is an HsvSession object reference
Set cSysInfo = m_cHsvSession.SystemInfo
cSysInfo.GetVBScriptCalcRules vaRules, bRulesExist
If bRulesExist = True Then
  iFile = FreeFile
  Open "C:\Program Files\Acme\appRules.rle" For Output As #iFile
  Print #iFile, StrConv(CStr(vaRules), 64)
  Close #iFile
End If