Page History
9.72 FILLSTRING
| Note | ||
|---|---|---|
| ||
| Built-In Function Rules Usage Options |
Fills a field with as many occurrences of a specified string as will fit in a given field.
Arguments
|
Return Values
|
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
...
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
...
then,
FUN01 Fillstring BIF
...