10 6 54 RightAdjust

LANSA Technical

10.6.54 RightAdjust

RightAdjust shifts the value in a string as far to the right as allowed by either the length parameter or the string's length, whichever is smaller.  The left of the value is filled with the contents of the pad parameter, or blank spaces if the pad isn't provided.

Input Parameters (both optional)

Length - the length within which to right-adjust the string's value.

Pad - a character used to pad space created to the left of the value.

Examples

define field(#source) type(*string) length(10)

define field(#target) type(*string) length(10)

 

* in this example, #target will be set to "       abc"

#source := "abc"
#target := #source.RightAdjust
 

* in this example, #target will be set to "  abc"

#target := #source.RightAdjust( 5 )
 

* in this example, #target will be set to "xxabc"

#target := #source.RightAdjust( 5, "x" )
 

Ý 10.6 Alphanumeric/String Intrinsic Functions