String Examples

Example 1. Displaying the form title in capital letters.

// Display Aisle name on the form title.

Form.Title = String.ToUppercase(strTemp)

Note:

Example 2. Determining the string length of the user input to check if the child form should be opened.

IF String.Length(edtCustNum) == 5

{

    // Enter code to check if CustNum exists.

    // Code to open the Customer Details form.   

  

}

Note:

Example 3. Trimming the string input before passing as a parameter for the listview query.

lvSearch.QSearchByKeyword.pKeyword = "%" & String.Trim(edtKeyword) & "%"

lvSearch.Refresh()

Note:

Example 4. Derive the date saved as a string value and display on a dateTime control.

tempValue = DATE_ENTERED

intDay = String.Left(tempValue, 2)

strMonth = String.Mid(tempValue, 3, 3)

intYear = String.Right(tempValue, 4)

cbMonthMap = String.ToUppercase(strMonth)

intDay = Number.ToInteger(intDay)

intMonth = cbMonthMap.GetSelection()

intYear = Number.ToInteger(intYear)

dtDateTime = DateTime.CreateDate(intYear, intMonth, intDay)

Note: