GetDateValue Example for Visual Basic
Private Sub TestProc9()
Dim lCount As Long
Dim nRet As Integer
LEADDICOM1.EnableMethodErrors = False
'move to the root element
LEADDICOM1.MoveFirstElement False
LEADDICOM1.MoveRootElement
'insert a new element for the Date Value
LEADDICOM1.InsertElement False, TAG_PATIENT_BIRTH_DATE, VR_DA, False, 0
'insert an Date value into the element
LEADDICOM1.DateValueCount = 1
LEADDICOM1.DateValues(0).Year = 1971
LEADDICOM1.DateValues(0).Month = 12
LEADDICOM1.DateValues(0).Day = 12
'set the date
nRet = LEADDICOM1.SetDateValue(1)
If (nRet <> 0) Then
MsgBox "Error"
Exit Sub
End If
LEADDICOM1.DateValueCount = 0 'free the value
Text1.Visible = True
Text1.Text = ""
'get the value count
lCount = LEADDICOM1.GetValueCount
MsgBox "There are " & CStr(lCount) & " values!"
'get the value
nRet = LEADDICOM1.GetDateValue(0, lCount)
'display the value
Text1.Text = "Year: " & CStr(LEADDICOM1.DateValues(0).Year) & " Month: " & CStr(LEADDICOM1.DateValues(0).Month & " Day: " & CStr(LEADDICOM1.DateValues(0).Day))
LEADDICOM1.EnableMethodErrors = True
MsgBox "wait"
End Sub