home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / CLIPUDF.ARC / CENTER.PRG next >
Text File  |  1986-02-04  |  512b  |  20 lines

  1. *Title........CENTER
  2. *Syntax.......CENTER(expC)
  3. *Paramenters..Any string less than 80 characters in length.
  4. *Returns......The appropriate column position to center the line.
  5. *Notes........Use this function in place of a column coordinate.
  6. *                @ 12, CENTER("Hello") SAY "Hello"
  7.  
  8. FUNCTION CENTER
  9.  
  10. PARAM string
  11.  
  12. col_pos = LEN(string)
  13. IF col_pos < 80
  14.    col_pos = INT((80 - col_pos) / 2)
  15. ELSE
  16.    col_pos = 0
  17. ENDIF
  18.  
  19. RETURN (col_pos)
  20.