<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_GetTrimString |
Declare Function sx_GetTrimString Lib "Apollo9.dll"
(ByVal cpFieldName As String)
As String
Extracts the contents of any field as a string and trim trailing spaces.
LONG FAR PASCAL sx_GetTrimString
(BYTEP cpFieldName);
cpFieldName: The name of the field.
The field contents are returned as a string with trailing spaces removed.
This is the function to use when loading an edit control (i.e., DBEdit box). Trailing spaces are invisible to the user and an edit control that has a defined data entry length becomes difficult to edit when it is full of white space to the right of the data.
Sub Brw1_Change (nRowCol As Integer)
' whenever rec no changes, dynamically
' display memo and other detail data
If nRowCol <> BRW_CHANGE_COL Then
If sx_Empty("notes") Then
tMemo.Text = ""
Else
tMemo.Text = sx_GetMemo("notes", 0)
End If
tLast.Text = sx_GetTrimString("last")
tCity.Text = sx_GetTrimString("city")
tCountry.Text = sx_GetTrimString("country")
tPhone.Text = sx_GetTrimString("ph_voice")
End If
End Sub
// check if name should be in red
lstrcpy((LPSTR) caRecord, (LPSTR) sx_GetTrimString((BYTEP) "business"));
if (lstrcmpi((LPSTR) caRecord, (LPSTR) "PLUMBER") == 0)
cColor = 13; // red
else
cColor = 1; // black