home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / gt_cent.prg < prev    next >
Text File  |  1993-10-14  |  1KB  |  50 lines

  1. /*
  2.  * File......: GT_Cent.prg
  3.  * Author....: Niall Scott
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Niall Scott
  7.  * Date......: 29/6/93
  8.  * Revision..: 1.0
  9.  * Log file..: $Logfile$
  10.  *
  11.  * This is an original work by Niall R Scott and is placed in the
  12.  * public domain.
  13.  *
  14.  * Modification history:
  15.  * ---------------------
  16.  *
  17.  * Rev 1.0  29/6/93
  18.  * Initial Revision
  19.  */
  20.  
  21. /*  $DOC$
  22.  *  $FUNCNAME$
  23.  *     GT_CENT()
  24.  *  $CATEGORY$
  25.  *     String
  26.  *  $ONELINER$
  27.  *     Get start of string to center it in an area
  28.  *  $SYNTAX$
  29.  *     nPos := GT_Cent(<cStr>, <nLen>)
  30.  *  $ARGUMENTS$
  31.  *     cStr := String to be centered
  32.  *       nLen := Length of area to center string in
  33.  *  $RETURNS$
  34.  *     Starting postion
  35.  *  $DESCRIPTION$
  36.  *     To ascertain the the starting position of a string to
  37.  *     enable it to be centered in a given area
  38.  *  $EXAMPLES$
  39.  *       nPos := GT_Cent( space(20), 40 )
  40.  *     nPos will equal 10
  41.  *  $SEEALSO$
  42.  *
  43.  *  $INCLUDE$
  44.  *
  45.  *  $END$
  46.  */
  47.  
  48. FUNCTION GT_Cent( cMsg, nLen )
  49. RETURN (INT( (nLen -Len(cMsg )) /2))
  50.