home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol12n07.zip / DELKEY.SC next >
Text File  |  1993-03-11  |  872b  |  29 lines

  1. CREATELIB "Paradox"
  2. ;-----------------------------------------------------------------
  3. ; PROC Delkey                                           Paradox
  4. ; Create the procedure Delkey to query the user before deleting
  5. ; a record
  6. ;-----------------------------------------------------------------
  7. PROC Delkey ()
  8. ; Only change delete function if editing or coediting and not editing
  9. ; a field
  10. IF IMAGETYPE() = "Display" AND (SYSMODE() = "Edit" OR
  11. SYSMODE() = "CoEdit") AND ISFIELDVIEW() = FALSE
  12.   THEN BEEP
  13.      MESSAGE "Do you really want to delete record #",
  14.        RECNO(), "? (y/n)"
  15.      x = GETCHAR()
  16.      ; If the user types "y" delete, otherwise quit
  17.      IF x = ASC("y") OR x = ASC("Y")
  18.          THEN DEL
  19.      ENDIF
  20.   ELSE DEL
  21. ENDIF
  22. ENDPROC
  23. WRITELIB "Paradox" Delkey
  24.  
  25. ; Sample Init.sc file
  26. Autolib = "C:\\PDOX\\Paradox"
  27. setkey -83 delkey()
  28.  
  29.