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

  1. *****************************************************************
  2. FUNCTION DBVIEW (dbe_mode)
  3. *****************************************************************
  4.  
  5. * A DBEDIT view control used when AEDBAR is active
  6.  
  7. * Copyright(c) 1991 -- James Occhiogrosso
  8.  
  9. # include "inkey.ch"
  10.  
  11. LOCAL keypress := LASTKEY(), ret_value := 1
  12.  
  13. DO CASE
  14.     * Mode is idle, put a general message in window
  15.     CASE dbe_mode = 0
  16.        AEDMSG('mw_view')
  17.  
  18.     * At top of file, beep and say blinking "bof" message
  19.     CASE dbe_mode = 1
  20.        ERRORBEEP()
  21.        AEDMSG('mw_bof', colblink)
  22.  
  23.     * At bottom of file, beep and say blinking "eof" message
  24.     CASE dbe_mode = 2
  25.        ERRORBEEP()
  26.        AEDMSG('mw_eof', colblink)
  27.  
  28.     * Empty file. Display message.
  29.     CASE dbe_mode = 3
  30.        AEDMSG('File is empty')
  31.  
  32.     * Any other key
  33.     CASE dbe_mode = 4
  34.         IF (keypress <= K_F2 .OR. keypress > 256 ;
  35.               .OR. keypress = K_F1) .AND. TYPE('fkeyset') != 'U'
  36.  
  37.             * Call special keys procedure if any function key or
  38.             * alternate key combination is pressed. The variable,
  39.             * "fkeyset" must contain the procedure name.
  40.  
  41.             IF .NOT. EMPTY(fkeyset)
  42.                 SETCOLOR(old_color)
  43.                 DO &fkeyset WITH 'DBVIEW', 0, '', keypress
  44.             ENDIF
  45.         ELSE
  46.             * End the view and return
  47.             AEDMSG('mw_pgdn')
  48.             ret_value = 0
  49.         ENDIF
  50. ENDCASE
  51.  
  52. RETURN ret_value
  53.  
  54.  
  55.