LC function

Converts any uppercase characters in a CHARACTER or LONGCHAR expression to lowercase characters, and returns the result. The data type of the returned value matches the data type of the expression passed to the function.

Syntax

LC ( expression )
expression
A constant, field name, variable name, or expression that results in a CHARACTER or LONGCHAR value.

Example

This procedure finds a Customer record. After the user updates the SalesRep field, the procedure converts the first character of the SalesRep value to uppercase and the remaining characters to lowercase.

r-lc.p

REPEAT:
  PROMPT-FOR Customer.CustNum.
  FIND Customer USING Customer.CustNum.
  DISPLAY Customer.Name.
  UPDATE Customer.SalesRep.
  Customer.SalesRep = CAPS(SUBSTRING(Customer.SalesRep, 1, 1) ) +
    LC(SUBSTRING(Customer.SalesRep, 2) ).
  DISPLAY Customer.SalesRep.
END.

The CAPS function uses the SUBSTRING function to extract the first character of the field, which it then converts to uppercase.

In the LC function, the result of the SUBSTRING function is the remaining characters in the SalesRep field, starting with character position 2. (No length is specified, so the remainder of the string is assumed). The LC function converts these characters to lowercase.

Notes

See also

CAPS function