9 93 FILLSTRING

LANSA Technical

9.93 FILLSTRING

Þ Note: Built-In Function Rules.

Fills a field with as many occurrences of a specified string as will fit in a given field.

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 repeated

1

Unlimited

 

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Returned string

1

Unlimited

 

 

 

 

Note: This function will put as many occurrences of a string as will fit. If the target field length is not a multiple of the length of the string to be repeated, the last occurrence will be truncated.

Examples

Fill a field with the character '*' (asterisk).

DEFINE     FIELD(#OUTEXT)  TYPE(*CHAR) LENGTH(10)
**********
USE        BUILTIN(FILLSTRING) WITH_ARGS('''*''') TO_GET(#OUTEXT)
DISPLAY    FIELDS(#OUTEXT)
 

Resulting display would look something like this:

 

       FUN01          Fillstring BIF       

                                              

       Out text . . . ********************

                                              

       CF1=Help                              

                                              

 

Fill a string with a requested value.

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

Resulting displays would look something like this:

 

       FUN01         Fillstring BIF       

                                             

       In text . . . FRED                  

                                             

       CF1=Help                             

                                             

 

then,

 

       FUN01          Fillstring BIF      

                                              

       Out text . . . FREDFREDFREDFREDFR

                                              

       CF1=Help