SetCurrency Method for LCField

This method sets a field value to a supplied LCCurrency value. If the field is not of a Currency data type, Notes® will attempt to convert the supplied value to the data type of the field. If conversion fails, error LCFAIL_INVALID_CONVERT will occur.

The data type of the field will not change to Currency because of this operation. It will stay the same type but its value will change.

Defined In

LCField

Syntax

Call thisField.SetCurrency (index, srcCurrency)

Parameters

Parameter

Description

index

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

srcCurrency

LCCurrency. Value to be assigned to the field data value.

Example

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim field As New LCField (LCTYPE_TEXT)
  Dim number As New LCCurrency
  number.value = 1234567890.1234
  Call field.SetCurrency (1, number)
  Print "The field's value is " & field.text(0)
End Sub

Example Output

The field's value is 1234567890.1234.