home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SOURCE.EXE / F_READAB.PRG < prev    next >
Encoding:
Text File  |  1991-01-25  |  1.2 KB  |  48 lines

  1. *****************************************************************
  2. FUNCTION READABORT (msg_line)
  3. *****************************************************************
  4.  
  5. * Asks for operator confirmation before aborting READ
  6.  
  7. * Copyright(c) 1991 -- James Occhiogrosso
  8.  
  9. # include "inkey.ch"
  10.  
  11. LOCAL message := 'Abandon this record?  Y/N  '
  12. LOCAL old_screen := '', ret_value := .F.
  13.  
  14. * Test for Escape key
  15. IF LASTKEY() = K_ESC
  16.  
  17.     * If message line not passed, default to bottom screen row
  18.     msg_line := IF(VALTYPE(msg_line) = 'N', msg_line, MAXROW())
  19.  
  20.     * If AEDBAR is in use AEDMSG displays message.
  21.     * Otherwise, message appears on passed line number.
  22.  
  23.     IF .NOT. AEDMSG(message)
  24.         * AEDBAR not in use, use message line
  25.         old_screen = SCRNSAVE(msg_line, 0, msg_line, MAXCOL())
  26.         CENTERON(msg_line, message)
  27.     ENDIF
  28.  
  29.     * Move cursor to end of message text
  30.     @ ROW(), COL() SAY ''
  31.     ?? CHR(7)
  32.  
  33.     IF OPCONFIRM()
  34.         * Operator confirms abandoning record
  35.         ret_value = .T.
  36.     ENDIF
  37.  
  38.     * If we saved a screen area, restore it.
  39.     IF .NOT. EMPTY(old_screen)
  40.         SCRNREST(old_screen)
  41.     ENDIF
  42.  
  43. ENDIF
  44.  
  45. RETURN (ret_value)
  46.  
  47.  
  48.