SetVirtualCode Method for LCField

This method adds a virtual code to the list of virtual codes for a field. Virtual codes flag fields as special system properties recognized by different systems. Refer to the connector documentation for specific codes supported by each connection.

Defined In

LCField

Syntax

Call thisField.SetVirtualCode (virtualCode)

Parameters

Parameter

Description

virtualCode

Long. VirtualCode value to assign to this Field.

Example

Option Public
Uselsx "*lsxlc" 
Sub Initialize
  Dim session As New LCSession
     ' In an HEI Scripted Agent, use the following syntax instead:
     ' Dim session As New LCSession ("mySession")
  Dim field As New LCField (LCTYPE_INT)
  Dim Code As Long
  Dim text As String
  Call session.ListConnector (LCLIST_FIRST, , Code)
  Call field.SetVirtualCode (Code)
  text = Hex(Code) & "h"
  While session.ListConnector (LCLIST_NEXT, , Code)
    Call field.SetVirtualCode (Code)
    text = text & ", " & Hex(Code) & "h"
  Wend
  Print "The field virtual codes (one per connector) are " & text
End Sub

Example Output

The field virtual codes (one per connector) are 10000h, 20000h, 30000h, 40000h, 50000h.