downshift()

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

downshift() 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, downshift() can be used, or you can assign the value returned by the function to a variable.

As shown in this code sample, the user enters a string input_string using fgl_winprompt(). 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

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.