Top  >  Lycia reference  >  Querix 4GL  >  Functions  >  String  >  downshift()

downshift()

 

The DOWNSHIFT( ) function takes a character expression as its argument, and returns a string value in which all uppercase characters in its argument are converted to lowercase.

Usage

The DOWNSHIFT( ) function is typically called to regularize character data.  It could be used, for example, when handling US addresses data, to stop a state abbreviation entered as NY, Ny, or ny from resulting in different values, if within your application, they should all be considered as the same value

Non-alphabetic or lowercase characters are not altered by DOWNSHIFT( ).  The maximum data length of the argument (and of the returned character string value) is 32,766 bytes.

Where an expression allows it, the DOWNSHIFT( ) function can be used, or you can assign the value returned by the function to a variable.

As shown in the following code sample, the user enters a string input_string using the fgl_winprompt function. Next, the functions DOWNSHIFT and UPSHIFT convert the string to upper/lower case.

MAIN

 

  DEFINE input_string char(50)

 

CALL fgl_winprompt(5,5,"Enter a string - max 50 characters", "not-specified", 50, 0) returning input_string

 

  #convert to lower case

CALL fgl_winmessage("DOWNSHIFT converts to lowercase", DOWNSHIFT(input_string), "info")

 

  #convert to upper case

CALL fgl_winmessage("UPSHIFT converts to uppercase", UPSHIFT(input_string), "info")

 

END MAIN

 

Reference

UPSHIFT( )