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

  1. /*
  2.  * File......: BARUPDATE.PRG
  3.  * Author....: Martin Colloby
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Martin Colloby
  7.  * Date......: 18/4/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Martin Colloby and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20.  
  21. /*  $DOC$
  22.  *  $FUNCNAME$
  23.  *      GT_BARUPDATE()
  24.  *  $CATEGORY$
  25.  *      Video
  26.  *  $ONELINER$
  27.  *      Update a bar on screen
  28.  *  $SYNTAX$
  29.  *      GT_BarUpdate( nCurrent , nTotal , nTop , nLeft )
  30.  *  $ARGUMENTS$
  31.  *      nCurrent - Current value to be displayed
  32.  *      nTotal   - Maximum value that can be displayed
  33.  *      nTop     - Bar row
  34.  *      nLeft    - Left column of bar
  35.  *  $RETURNS$
  36.  *      NIL
  37.  *  $DESCRIPTION$
  38.  *      Updates a bar at the given coordinates.  The length of the bar is
  39.  *      given by :
  40.  *
  41.  *          nCurrent / nTotal * 40
  42.  *  $EXAMPLES$
  43.  *
  44.  *  $SEEALSO$
  45.  *
  46.  *  $INCLUDE$
  47.  *      GT_LIB.CH
  48.  *  $END$
  49.  */
  50.  
  51. *
  52. #include "GT_lib.ch"
  53.  
  54. FUNCTION GT_BarUpdate( nCurrent , nTotal , nTop , nLeft )
  55.  
  56. /*****************************************************************************
  57.  Purpose - Update a moving bar chart
  58.  Returns - None
  59.  Author  - Martin Colloby
  60.  Created - 05/08/91
  61. ******************************************************************************
  62.  Purpose    - Update the current bar chart - created by BarInit()
  63.  Parameters - nCurrent - Current value
  64.               nTotal   - Maximum value
  65.  Parameters - None
  66.  Privates   - None
  67.  Locals     - None
  68.  Externals  - None
  69. *****************************************************************************/
  70.  
  71. DEFAULT nTop  TO MAXROW() - 5
  72. DEFAULT nLeft TO 20
  73.  
  74. * Output the bar
  75. @ nTop + 1 , nLeft + 2 SAY REPLICATE( "▄" , INT( ( nCurrent / nTotal ) * 40 ) )
  76.  
  77. RETURN NIL
  78. *
  79.