9 206 RIGHT

LANSA Technical

9.206 RIGHT

Þ Note: Built-In Function Rules.

Right aligns argument into return string.

For use with

LANSA for i

YES

Visual LANSA for Windows

YES

Visual LANSA for Linux

YES

 

 

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

String to be right align

1

256

 

 

2

A

Opt

Remove imbedded blanks flag (Y/N)

Values:

Y = remove

N = do not remove

Default: N

1

1

 

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return right aligned string

1

256

 

 

 

 

Example

Right align and remove imbedded blanks from a requested string.

DEFINE     FIELD(#INTEXT)  TYPE(*CHAR) LENGTH(18)
DEFINE     FIELD(#OUTEXT)  TYPE(*CHAR) LENGTH(18)
**********
REQUEST    FIELDS(#INTEXT)
USE        BUILTIN(RIGHT) WITH_ARGS(#INTEXT Y) TO_GET(#OUTEXT)
DISPLAY    FIELDS(#OUTEXT)
 

Resulting displays would look something like this:

 

        FUN01          Right Example        

                                               

        In text . . .     FR   E     D      

                                              

        CF1=Help                             

                                              

then,

 

        FUN01          Right Example         

                                                

        Out text . . .                   FRED

                                                

        CF1=Help