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

  1. /*
  2.  * GT CLIPPER STANDARD HEADER
  3.  *
  4.  * File......: savescr.prg
  5.  * Author....: Andy M Leighton
  6.  * BBS.......: The Dark Knight Returns
  7.  * Net/Node..: 050/069
  8.  * User Name.: Andy Leighton
  9.  * Date......: $Date$
  10.  * Revision..: $Revision$
  11.  *
  12.  * This is an original work by Andy Leighton and is placed in the
  13.  * public domain.
  14.  *
  15.  * Modification history:
  16.  * ---------------------
  17.  *
  18.  * $Log$
  19.  *
  20.  */
  21.  
  22. /*  $DOC$
  23.  *  $FUNCNAME$
  24.  *       GT_SAVESCR()
  25.  *  $CATEGORY$
  26.  *       Video
  27.  *  $ONELINER$
  28.  *       Save a screen.
  29.  *  $SYNTAX$
  30.  *       GT_saveScr([<nTop>], [<nLeft>], [<nBottom>], [<nRight>])
  31.  *                                                             --> cScr
  32.  *  $ARGUMENTS$
  33.  *       <nTop>    - Top line of screen area to save,
  34.  *                   defaults to 0
  35.  *       <nLeft>   - Leftmost col. of screen area to save,
  36.  *                   default to 0
  37.  *       <nRight>  - Rightmose col. of screen area to save,
  38.  *                   defaults to maxrow()
  39.  *       <nBottom> - Bottom line of screen area to save,
  40.  *                   defaults to maxcol()
  41.  *  $RETURNS$
  42.  *       cScr      - A string consisting og position information +
  43.  *                   saved screen as a character string
  44.  *  $DESCRIPTION$
  45.  *       Save screen (or partial screen) with position
  46.  *
  47.  *       Would have been nicer to save as an array but that would
  48.  *       have wasted too much memory.
  49.  *
  50.  *       NOTE: If you use C, be aware that the return string
  51.  *             can and often does contain embedded NULs
  52.  * $SEEALSO$
  53.  *       GT_RESTSCR()
  54.  *  $EXAMPLES$
  55.  *  $END$
  56.  */
  57.  
  58. #include "gt_LIB.ch"
  59.  
  60. function GT_saveScr(nTop, nLeft, nBottom, nRight)
  61.  
  62.    local cScr
  63.  
  64.    default nTop    to 0
  65.    default nLeft   to 0
  66.    default nBottom to maxrow()
  67.    default nRight  to maxcol()
  68.  
  69.    cScr := chr(nTop) + chr(nLeft) + chr(nBottom) + chr(nRight) +;
  70.            savescreen(nTop, nLeft, nBottom, nRight)
  71.  
  72. return cScr
  73.