New Method for LCField

This is the constructor method for LCField. It initializes an LCField object.

Defined In

LCField

Syntax

Dim variablename As New LCField(type, count)

Parameters

Parameter

Description

type

Long. Data type of the field object, one of the following constants:

LCTYPE_CURRENCY

LCTYPE_DATETIME

LCTYPE_INT

LCTYPE_FLOAT

LCTYPE_NUMERIC

LCTYPE_TEXT

LCTYPE_BINARY

count

Long. Optional, >=1. Number of data values to be allocated for this field. The default is 1. Using a higher number essentially creates an array of values, indexed from 1 to count, letting you store multiple values of the same type in the field. This is useful as an element of an LCFieldlist that is also allocated to the same number of elements (see the New method of LCFieldlist), allowing you to fetch or update multiple records in a single operation.

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 person As New LCField(LCTYPE_TEXT, 10) ' sufficient space to 
                               'store 10 "rows" of name information.
  Dim dateOfBirth As New LCField(LCTYPE_DATETIME, 10) ' ten dates
  Dim outputFields As New LCFieldlist(10, LCFIELDF_KEY) ' a field list
                                'for 10-element fields.
  Call outputFields.IncludeField(1, person, "PERSON")
  Call outputFields.IncludeField(2, dateOfBirth, "BIRTH_DATE")
     ' outputFields is ready to be used to "insert" or "update" 
     ' up to 10 records of name/birthdate simultaneously 
     ' (once you put data in the fields). This could instead 
     ' have been done using the LCFieldlist.Append method, making
     ' it unnecessary to use the New method of LCField.