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

  1. /*
  2.  * File......: GTBIGTIM.PRG
  3.  * Author....: Brian Dukes
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Brian Dukes
  7.  * Date......: $Date$
  8.  * Revision..: $Revision$
  9.  * Log file..: $Logfile$
  10.  *
  11.  * This is an original work by Brian Dukes and is placed in the public
  12.  * domain.
  13.  *
  14.  * Modification history:
  15.  * ---------------------
  16.  *
  17.  * $Log$
  18.  *
  19.  */
  20.  
  21. /*  $DOC$
  22.  *  $FUNCNAME$
  23.  *      GT_BIGTIME()
  24.  *  $CATEGORY$
  25.  *      General
  26.  *  $ONELINER$
  27.  *      Display the current time in BIG DIGITS
  28.  *  $SYNTAX$
  29.  *      GT_BigTime(<nRow>,<nCol>,<cColor>)
  30.  *  $ARGUMENTS$
  31.  *       <nRow>    Row number to print the time at.
  32.  *       <nCol>    Column number to print the time at.
  33.  *       <cColor>  Colour to display the time in.
  34.  *
  35.  *  $RETURNS$
  36.  *      Nothing.
  37.  *
  38.  *  $DESCRIPTION$
  39.  *     GT_BigTime() was originally written for use by the GT_Clock()
  40.  *     screen saver; but it can be used separately for displaying the
  41.  *     current time.
  42.  *
  43.  *  $EXAMPLES$
  44.  *      GT_BigTime(10,10,"R+/N")
  45.  *  $END$
  46.  */
  47.  
  48. function GT_BigTime(nRow,nCol,clr)
  49.    LOCAL ClockDigit[4]
  50.    local c      := 0
  51.    LOCAL tim    := time()
  52.    LOCAL Str    := { "","","","" }
  53.    LOCAL count  := 0
  54.  
  55.    clockDigit[1] := "▄▄▄  ▄  ▄▄▄ ▄▄▄ ▄ ▄ ▄▄▄ ▄   ▄▄▄ ▄▄▄ ▄▄▄     "
  56.    clockDigit[2] := "█ █  █    █   █ █ █ █   █     █ █ █ █ █  █  "
  57.    clockDigit[3] := "█ █  █  █▀▀  ▀█ ▀▀█ ▀▀█ █▀█   █ █▀█ ▀▀█     "
  58.    clockDigit[4] := "█▄█  █  █▄▄ ▄▄█   █ ▄▄█ █▄█   █ █▄█   █  █  "
  59.  
  60.    for count := 1 to len(tim)
  61.       c := ((asc(substr(tim,count,1))-48)*4)+1
  62.       Str[1] += substr(ClockDigit[1],c,4)
  63.       Str[2] += substr(ClockDigit[2],c,4)
  64.       Str[3] += substr(ClockDigit[3],c,4)
  65.       Str[4] += substr(ClockDigit[4],c,4)
  66.    next
  67.  
  68.    @ nRow+0,nCol say Str[1] color clr
  69.    @ nRow+1,nCol say Str[2] color clr
  70.    @ nRow+2,nCol say Str[3] color clr
  71.    @ nRow+3,nCol say Str[4] color clr
  72.  
  73. return NIL
  74.