ArchView - User functions

A user function can be defined for each view in the column D (User function). The definition consists of the function name and parameters, which are separated by semicolon ;.

If the function has been defined for a view, each displayed value in view is a result of its calling. The user function must be defined in a module UserFunkcie and must contain the following parameters:

Private Function UserFunction(ArcBId As Long, Id As Long, NumItems As Long, UserParams As Variant) As Variant

where:
ArcBId     - internal identifier of archive block
Id           - consecutive number of value which will be displayed. The value of parameter is:

    • -1, in the case of initialization of function
    • NoDataTime, if any value does not exist for the given cell
    • NoDataValid, if there is not defined any value for the given cell

NumItems     - size of longer side of view (viewing area), for which the function has been defined, or -1, in the case of initialization of function
UserParams   - array of user parameters defined in view definition.

You can accomplish the required calculation or modification of displayed value. Within this function, you can call the following functions:

Getting the value to be displayed


Getting the value to be displayed by its consecutive number in archive block

Property Get GetActualD2DataObj(Index As Long, ByRef D2DataObj As VBApi_TUniVal) As Long

Index - consecutive number of value in archive block (parameter Id in UserFunction)
D2DataObj
- value from archive

Return value:

  • D2DataIdNotValid - no data
  • RetOk - D2DataObj contains the required value

Getting the total number of values in archive block


Property Get GetActualD2DataObjItems() As Long

When an error occurs, the return value is -1.

Getting the begin time of current archive block


Property Get GetActualD2DataBT() As Date

When an error occurs, the return value is D2DataIdNotValid.

Getting the value by its consecutive number from the archive block


Property Get GetD2DataObj(ArchBlockId As Long, Index As Long, ByRef D2DataObj As VBApi_TUniVal) As Long

ArchBlockId  - number of archive block (parameter of user function)
Index
          - consecutive number of value in archive block (parameter Id in UserFunction)
D2DataObj
   - value from archive

Return value:

  • D2DataIdNotValid - no data
  • RetOk - D2DataObj contains the required value
  • ArchBlockNoExist - the required archive block does not exist

Transfer between the archive block name and its numerical identifier


Property Get GetArchBlockId(ArchBlock As String) As Long

When an error occurs, the return value is ArchBlockNotExist.

Napíšte komentár