cpadd (Aug2004) |
rjtools
|
cpadd (Aug2004) |
cpadd
cpadd - padd a string to right or left with arbitrary character
cpadd cline [pchar] [nchar] [paddleft] [verbose]
- cline = ""
- Character string to padd
- pchar = ""
- Arbitrary character to use for padding. Default is a <space> character.
- nchar = 80
- Number of characters to padd the input string to. Default is 80.
- paddleft = no
- Padd the input string to the left rather than to the right?
- verbose = no
- Print the resulting padded string to the standard output?
- (cpadd) [string]
- Parameter returning the padded input string
Task to padd input character string 'cline' to 'nchar' characters to the
right (default), or left (when switch 'paddleft' is set to "yes"). The
default character used for padding is a <space> and the default number
of characters to padd (to the right) to is 80. Upon exit of this task,
parameter 'cpadd' will contain the padded input character string. If the
'verbose' switch is set, the result is also printed to the standard
output.
If the input character string is 'nchar' characters or more in length,
this task returns the input string unchanged.
1. Padd a string with dots to the right and store the result for later use:
rj> cpadd ("Iteration 1 ", pchar=".", nchar=32, verbose-)
Task parameter 'cpadd.cpadd' will now store text sting:
"Iteration 1 ...................."
2. Padd a string with hash marks to left and right (e.g., for a header
of a text log file):
rj> cpadd (cpadd.cpadd, pchar="#", nchar=72, paddleft+, verbose+)
############################ SOME PROGRAM ############################