home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST74.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  872 b   |  36 lines

  1. ********************                              
  2.                                                   
  3. FUNCTION Mess_cent                                
  4.                                                   
  5.    PARAMETERS _a1, _a2, _a3
  6.  
  7.    PRIVATE _d, _e, _f
  8.  
  9.    * _a1 is the string
  10.    * _a2 is the line's length
  11.    * _a3 is the character to center the message with
  12.    * _d is the length of _a
  13.    * _e is the length of the line minus half of the string's length
  14.    * _f is the total length
  15.  
  16.    IF PCOUNT() = 1
  17.       _a2 = 80
  18.       _a3 = " "
  19.    ELSEIF PCOUNT() = 2
  20.       _a3 = " "
  21.    ENDIF
  22.  
  23.    IF !EMPTY(_a3)
  24.       _a1 = " " + _a1 + " "
  25.    ENDIF
  26.  
  27.    _a2 = INT(_a2 / 2)
  28.  
  29.    _d = LEN(_a1)
  30.    _e = INT(_a2 - _d / 2)             
  31.    _f = (2 * _a2) - _d - _e            
  32.  
  33.    RETURN( REPLICATE(_a3, _e) + _a1 + REPLICATE(_a3, _f) )
  34.  
  35. * End of File
  36.