<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_GetDateString |
Declare Function sx_GetDateString Lib "Apollo9.dll"
(ByVal cpFieldName As String)
As String
LONG FAR PASCAL sx_GetDateString
(BYTEP cpFieldname);
Extracts the contents of a date field as a string formatted according to the date mask specified by sx_SetDateFormat and the setting of sx_SetCentury. The default value is American date format (MM/DD/YY).
Note: Many of the sx_Get* functions can be replaced with a single call to sx_GetVariant. The sx_Get* functions that return specific data types are primarily for C programmers who cannot use sx_GetVariant.
cpFieldName: The name of the field.
The date is returned as a string.
Sub List1_DblClick ()
Dim FldName As String
Dim dVal As Double
FldName = RTrim$((List1.Text))
If Len(FldName) > 0 Then
If sx_FieldType(FldName) = "N" Then
BoxInt.Text = Format$(sx_GetInteger(FldName), "00000")
BoxLong.Text = Format$(sx_GetLong(FldName), "0000000")
dVal = sx_GetDouble(FldName)
BoxDouble.Text = Format$(dVal, "000#.00")
End If
BoxString.Text = sx_GetString(FldName)
If sx_FieldType(FldName) = "D" Then
BoxDate.Text = sx_GetDateString(FldName)
Else
BoxDate.Text = ""
End If
Boxftype.Text = sx_FieldType(FldName)
Boxflen.Text = Format$(sx_FieldWidth(FldName), "000")
Boxfdec.Text = Format$(sx_FieldDecimals(FldName), "00")
If Not sx_Empty(FldName) Then
BoxEmpty.Text = "False"
Else
BoxEmpty.Text = "True"
End If
End If
End Sub
// build the browse record
brRecord.caName[0] = cColor;
brRecord.caName[1] = '\0';
lstrcat((LPSTR) brRecord.caName,
(LPSTR) sx_GetString((BYTEP) "name"));
lstrcpy((LPSTR) brRecord.caAddress,
(LPSTR) sx_GetString((BYTEP) "address"));
lstrcpy((LPSTR) brRecord.caPhone,
(LPSTR) sx_EvalString(
(BYTEP) "tran(phone, '@R (999) 999-9999')"));
lstrcpy((LPSTR) brRecord.caBusiness,
(LPSTR) sx_GetString((BYTEP) "business"));
lstrcpy((LPSTR) brRecord.caCreateDate,
(LPSTR) sx_GetDateString((BYTEP) "createdate"));
_fmemset(caRecord, 0, (size_t) sizeof(SDEBROWSE_REC));