LCField の GetDatetime メソッド

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

定義位置

LCField

構文

Set newDatetime = lcField.GetDatetime (index)

パラメータ

パラメータ

説明

index

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

戻り値

説明

newDatetime

LCDatetime。取り出されたデータ型の値です。

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim Fld As New LCField (LCTYPE_TEXT)
  Dim vDate As LCDateTime
  Fld.Text = "10/12/1998"
  Set vDate = Fld.GetDatetime (1)
  Print "The Datetime representation of the field is " & vDate.Text
End Sub

出力例

The Datetime representation of the field is 10/12/1998.