home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / vrac / homonlib.zip / CENTER.BAS < prev    next >
BASIC Source File  |  1995-04-13  |  664b  |  20 lines

  1. DEFINT A-Z
  2.  
  3. DECLARE SUB Center (row, text$)
  4.  
  5. SUB Center (row, text$)
  6. '****************************************************************************
  7. 'Centers text on the specified row.
  8. '****************************************************************************
  9.  
  10. col = 41 - (LEN(text$) \ 2)   'Calculate the column to place text at.
  11.  
  12. IF col < 1 THEN col = 1       'Avoid an error if text$ is really long.
  13.  
  14. LOCATE row, col               'If row is illegal, its the programmer's fault!
  15.  
  16. PRINT text$;                  'Use the semicolon in case we're on row 24 -
  17.                               'It will prevent the screen from scrolling up.
  18. END SUB
  19.  
  20.