home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / nfsrc21.zip / BLINK.PRG < prev    next >
Text File  |  1991-08-16  |  2KB  |  85 lines

  1. /*
  2.  * File......: BLINK.PRG
  3.  * Author....: Terry Hackett
  4.  * CIS ID....: 76662,2035
  5.  * Date......: $Date:   15 Aug 1991 23:02:56  $
  6.  * Revision..: $Revision:   1.2  $
  7.  * Log file..: $Logfile:   E:/nanfor/src/blink.prv  $
  8.  * 
  9.  * This is an original work by Terry Hackett and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log:   E:/nanfor/src/blink.prv  $
  16.  * 
  17.  *    Rev 1.2   15 Aug 1991 23:02:56   GLENN
  18.  * Forest Belt proofread/edited/cleaned up doc
  19.  * 
  20.  *    Rev 1.1   14 Jun 1991 19:51:06   GLENN
  21.  * Minor edit to file header
  22.  * 
  23.  *    Rev 1.0   01 Apr 1991 01:00:46   GLENN
  24.  * Nanforum Toolkit
  25.  *
  26.  */
  27.  
  28.  
  29. /*  $DOC$
  30.  *  $FUNCNAME$
  31.  *     FT_BLINK()
  32.  *  $CATEGORY$
  33.  *     Menus/Prompts
  34.  *  $ONELINER$
  35.  *     Display a blinking message on the screen
  36.  *  $SYNTAX$
  37.  *     FT_BLINK( <cMsg>, [ <nRow> ], [ <nCol> ] ) -> NIL
  38.  *  $ARGUMENTS$
  39.  *     <cMsg> is the string to blink.
  40.  *
  41.  *     <nRow> is an optional screen row for @...SAY, default current.
  42.  *
  43.  *     <nCol> is an optional screen col for @...say, default current.
  44.  *  $RETURNS$
  45.  *     NIL
  46.  *  $DESCRIPTION$
  47.  *     A quick way to blink a msg on screen in the CURRENT colors.
  48.  *     Restores colors on return.
  49.  *  $EXAMPLES$
  50.  *     FT_BLINK( "WAIT", 5, 10 )   // Blinks "WAIT" in current colors @ 5,10
  51.  *
  52.  *     @5,10 SAY "WAIT - Printing Report"
  53.  *     FT_BLINK( "..." )           //  Blink "..." after wait message...
  54.  *  $END$
  55.  */
  56.  
  57. #ifdef FT_TEST
  58.   FUNCTION MAIN()
  59.      FT_BLINK( "WAIT", 5, 10 )
  60.      return ( nil )
  61. #endif
  62.  
  63. FUNCTION FT_BLINK( cMsg, nRow, nCol )
  64.  
  65.   * Declare color restore var.
  66.   LOCAL cSavColor
  67.  
  68.   * Return if no msg.
  69.   IF (cMsg == NIL) ; RETURN NIL; ENDIF
  70.  
  71.   * Set default row and col to current.
  72.   nRow := IF( nRow == NIL, ROW(), nRow )
  73.   nCol := IF( nCol == NIL, COL(), nCol )
  74.  
  75.   cSavColor := SETCOLOR()                // Save colors to restore on exit.
  76.  
  77.   * IF blink colors not already set, add blink to current foreground color.
  78.   SETCOLOR( IF( ("*" $ LEFT(cSavColor,4)), cSavColor, "*" + cSavColor ) )
  79.  
  80.   @ nRow, nCol SAY cMsg                  // Say the dreaded blinking msg.
  81.   SETCOLOR( cSavColor )                  // It's a wrap, restore colors & exit.
  82.  
  83. RETURN NIL
  84.  
  85.