home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / bit / listserv / dbasel / 1169 < prev    next >
Encoding:
Text File  |  1992-11-10  |  4.0 KB  |  95 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!auvm!PCOCD2.INTEL.COM!THAMILTO
  3. X-Mailer: ELM [version 2.3 PL8]
  4. Message-ID: <9211102231.AA04522@frc600>
  5. Newsgroups: bit.listserv.dbase-l
  6. Date:         Tue, 10 Nov 1992 14:31:48 PST
  7. Reply-To:     thamilto@pcocd2.intel.com
  8. Sender:       "Discussion on the use of the dBase language and related
  9.               dialects" <DBASE-L@NMSUVM1.BITNET>
  10. From:         "(Tony Hamilton - FES~)" <thamilto@PCOCD2.INTEL.COM>
  11. Subject:      dBase IV 1.5 question
  12. Lines: 81
  13.  
  14. First of all, thanks to everyone who has responded to my previous questions.
  15. This list is a great resource!
  16.  
  17. Now, next problem:
  18.  
  19. This problem relates to the SET MESSAGE TO command. The problem surrounds
  20. an ON KEY procedure, and the only way to explain it is to give you a scaled
  21. down portion of the code in question:
  22.  
  23. ...
  24. SET FORMAT TO form
  25. ON KEY LABEL Ctrl-U DO Del_record
  26. READ
  27. ON KEY
  28. ...
  29.  
  30. PROCEDURE Del_record
  31.   DEFINE WINDOW d_input FROM ...
  32.   ACTIVATE WINDOW d_input
  33.   answer = SPACE(1)
  34.   @ 0,0 SAY "Are you sure (y/n) ?"
  35.   answer = INKEY(0)
  36.   IF answer = 121                    && 121 = "y"
  37.     ...
  38.     KEYBOARD CHR(27)
  39.   ENDIF
  40.   DEACTIVATE WINDOW d_input
  41. RETURN
  42.  
  43. Okay, the scenario is as follows. In the top procedure, I am editing a record
  44. in the database using a format file and the READ command. I want to be able
  45. to escape to a verification sequence when the user hits Ctrl-U to delete the
  46. record they are editing. The ON KEY commands work fine, as does everything
  47. else for that matter.
  48.  
  49. The Del_record procedure must use INKEY instead of READ, because it was
  50. executed in the middle of another READ, and you can only have one at a time.
  51. I tried this, and dBase didn't like it very well. Well, my problem is
  52. two-fold:
  53.  
  54. 1. The parent procedure above also sets the MESSAGE to something, like
  55.    "hit ctrl-u to delete" or whatever. I would like to get a MESSAGE to display
  56.    when the Del_Record procedure is executed, but the book says that MESSAGEs
  57.    only work with full-screen editing commands. So, my thought is that I must
  58.    simply write my message with SAY to the message line, and then erase it
  59.    when done. For many reasons, I would rather have a better way, if there is
  60.    one.
  61.  
  62. 2. More importantly, when Del_record finishes, dBase apparently gets to the
  63.    "deactivate window d_input" line, and then, strangely enough, removes
  64.    the message defined in the parent procedure, and displays the message
  65.    before that (from a popup not listed here). Apparently, there is a MESSAGE
  66.    stack somewhere, and the DEACTIVATE WINDOW command (or something in there)
  67.    is taking the last MESSAGE off of the stack, even though there wasn't one
  68.    associated with that window. At least, this is my assessment. Does anyone
  69.    understand what is happening, and how I can fix it? It is hardly appropriate
  70.    for someone to hit Ctrl-U to delete the record, get the verification window
  71.    and then answer "n" for NO, return to editing the record, and now see
  72.    "Function Menu" on the message line, when they should still see
  73.    "Hit ctrl-u to delete".
  74.  
  75. As an FYI, SET STATUS is OFF, and needs to be in this application. However,
  76. after toggling this to ON, the above two problems disappeared. The documentation
  77. offers some clues as to why this is, but is a little unclear. I have also
  78. tried (with set status off, as it needs to be), to use a SET MESSAGE TO
  79. command at the end of the Del_record procedure to try to "add" another
  80. MESSAGE to the "message stack" (if there is such a monster) to fool dBase,
  81. in order to fix problem #2, but it did not work. Finally, the KEYBOARD command,
  82. executed when the user hits "y" to confirm deletion, simply automates the
  83. exiting of the above READ session, since you wouldn't want to continue editing
  84. a record you just deleted, would you...
  85.  
  86. Any help would be greatly appreciated...
  87.  
  88.  
  89. --
  90. Tony Hamilton                 |
  91. -Intel Corporation            | voice: 916-356-3070
  92. --Folsom Engineering Services | mailstop: FM2-55
  93. ---Engineering Resource Group | email: thamilto@pcocd2.intel.com
  94. ----Software Technician       |
  95.