Convert Method for LCField

This method converts data values to the data type of a destination field.

Defined In

LCField

Syntax

Call destField.Convert(destIndex, srcField, srcIndex, valueCount)

Parameters

All parameters are required.

Parameter

Description

destIndex

Long, >= 1. Index of the first value in destField to be assigned.

srcField

LCField. Source field for the data values. Values will be converted to the data type of destField.

srcIndex

Long , >= 1. Index in srcField of the first data value to be converted and copied into destField.

valueCount

Long. Number of field values to be converted. If the end of either field is encountered before converting this number of data values, then the function stops at that point.

Example

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim f_field As New LCField (LCTYPE_FLOAT)
  Dim c_field As New LCField (LCTYPE_CURRENCY)
  f_field.value = 12345.123456789
  Call c_field.Convert (1, f_field, 1, 1)
  Print "The float field is " & f_field.text(0) & "and it was"
  Print "converted to a currency field as " & c_field.text(0)
End Sub

Example Output

The float field is 12345.123456789 and it was converted to a currency field as 12345.1235.