LCField の GetNumeric メソッド

このメソッドは、フィールドの値から numeric 値を取り出します。要求されたデータ型がフィールドのデータ型と異なる場合は、自動的に変換を実行します。変換を実行できない場合は、LCFAIL_INVALID_CONVERT エラーが発生します。

定義位置

LCField

構文

Set newNumeric = thisField.GetNumeric(index)

パラメータ

パラメータ

説明

index

Long、>= 1。取り出すフィールドのデータ値のインデックス。

戻り値

説明

newNumeric

LCNumeric。thisFieldindex 番目の値を numeric 型に変換したものです。

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim Fld As New LCField (LCTYPE_TEXT)
  Fld.Text = "1234.56789"
  Dim vNumr As LCNumeric
  Set vNumr = Fld.GetNumeric (1)
  Print "The Numeric representation of the field is " & vNumr.Text
End Sub

出力例

The Numeric representation of the field is 1234.56789