OS/2 Procedures Language 2/REXX


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


CENTER/CENTRE




     +-CENTER(-+
 >>--+         +--string,length -+-------+-)------><
     +-CENTRE(-+                 +-,pad--+

CENTER or CENTRE returns a string of length length with string centered in 
it, with pad characters added as necessary to make up length. The default 
pad character is blank. If the string is longer than length, it will be 
truncated at both ends to fit. If an odd number of characters are 
truncated or added, the right-hand end loses or gains one more character 
than the left-hand end. 
Here are some examples: 

CENTER(abc,7)               ->    '  ABC  '
CENTER(abc,8,'-')           ->    '--ABC---'
CENTRE('The blue sky',8)    ->    'e blue s'
CENTRE('The blue sky',7)    ->    'e blue '

Note:    This function can be called either CENTRE or CENTER, which avoids 
errors due to the difference between the British and American spellings.   

Inf-HTML End Run - Successful