home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a116 / 2.img / TOOLKIT / TOOLKIT.ZIP / LOOKSLCT.SC < prev    next >
Encoding:
Text File  |  1990-08-25  |  2.7 KB  |  56 lines

  1. ; Copyright (c) 1987-1989 Borland International.  All Rights Reserved.
  2. ;
  3. ; General permission to re-distribute all or part of this script is granted,
  4. ; provided that this statement, including the above copyright notice, is not
  5. ; removed.  You may add your own copyright notice to secure copyright
  6. ; protection for new matter that you add to this script, but Borland
  7. ; International will not support, nor assume any legal responsibility for,
  8. ; material added or changes made to this script.
  9. ;
  10. ; Revs.:  MJP 2/29/88, DCY 12/16/88
  11. ; ****************************************************************************
  12. ; When applied to a lookup table, LookupSelect allows you to determine the key
  13. ; a user presses to end the lookup help interaction.  Although it is possible
  14. ; to enter into lookup help from within a PAL WAIT command or DoWait, it is
  15. ; unfortunately not possible to determine the key a user presses to exit from
  16. ; lookup help.  Thus if you want to determine the key a user presses to
  17. ; exit lookup help, you'll need to call either this procedure or LookupWait.
  18. ; DoWait does not do any special processing within a lookup help interaction.
  19. ;
  20. ; LookupSelect does not allow a user to make changes to images.  It returns
  21. ; the keycode value of the key causing exit from the wait, either [F2] Do-It!
  22. ; or [Esc] ([Ctrl][Break] acts like [Esc]).  See also LookupWait, however.
  23. ; As with the PAL WAIT comand, LookupSelect exits BEFORE passing the exit key
  24. ; to Paradox.
  25. ;
  26. ; IMPORTANT:  LookupSelect uses the ImageRights ReadOnly command to prevent a
  27. ;             user from making changes to the current image.  On exit, it
  28. ;             removes all image restrictions.  Thus, if you have previously
  29. ;             applied an ImageRights command to the image you will need to
  30. ;             do so again after invoking LookupSelect.
  31. ;
  32. Proc LookupSelect()
  33.    Echo Normal             ;Display the table to the user
  34.    ImageRights ReadOnly    ;Prevent user from making changes to image
  35.    While True
  36.       Retval = GetChar()
  37.       If MenuChoice() = "Error" and  ;We could be in HELP, HELP INDEX, or ZOOM
  38.            (Retval = -60 or Retval = 27 or Retval = 0)
  39.          Then Quitloop
  40.          Else
  41.       Endif
  42.       If (Retval < -60 and Retval > -71)  ;Disable keys which would allow a
  43.            or Retval = -110 or Retval = -111 or Retval = -100 ; user to leave
  44.          Then Beep                                            ; or clear image
  45.          Else Keypress Retval
  46.       Endif
  47.    Endwhile
  48.    Echo Off
  49.    SyncCursor
  50.    If Retval = 0
  51.        Then Retval = 27            ;[Ctrl][Break] functions as an [Esc]
  52.    Endif                          ; from lookup help.
  53.    ImageRights            ;Restore image status of table
  54.    Return Retval
  55. Endproc
  56.