home *** CD-ROM | disk | FTP | other *** search
/ HomeWare 14 / HOMEWARE14.bin / prog / ks94an.arj / LOCKKEY.HDR < prev    next >
Text File  |  1994-04-24  |  3KB  |  95 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _LockKey(cProc, nLine, cVar, cPassword) --> NIL
  8.  
  9. PARAMETERS:
  10.  
  11. cProc    : Calling Procedure (supplied when called via SET KEY)
  12. nLine    : Line number       (supplied when called via SET KEY)
  13. cVar     : current variable  (supplied when called via SET KEY)
  14. cPassword: Password to unlock keyboard (Optional)
  15.  
  16. SHORT:
  17.  
  18. Clear and lock-up screen with password.
  19.  
  20. DESCRIPTION:
  21.  
  22. _LockKey() prompts the user for a keyboard lockup password, clears the screen
  23. and waits for that same password to be re-entered.  If the re-entered
  24. password matches the lockup password, the function returns control to the
  25. calling program.
  26.  
  27. If the optional cPassword is passed to the function, _LockKey() skips the
  28. "enter password" step and locks the keyboard with the password specified in
  29. cPassword.
  30.  
  31. In either case, the same password must be entered again to unlock
  32. the keyboard.
  33.  
  34.  
  35.  
  36.  
  37.  
  38. NOTE:
  39.  
  40. When ANY function is called via SET KEY TO ... it automatically receives
  41. THREE parameters indicating the calling procedure, the line number and
  42. the current variable (if any).
  43.  
  44. This means that the first three arguments must always be specified in order
  45. to ensure that the password ends up in the fourth, whether called directly
  46. or via a SET KEY call.
  47.  
  48. If you call this function directly, you MUST pass either dummy arguments,
  49. or better yet, NIL for the first three arguments (cProc, nLine and cVar),
  50. and the password in the fourth argument, cPassword!
  51.  
  52. TO CALL VIA HOTKEY:
  53. -------------------
  54.  
  55. _LockKey()
  56.  
  57. Result: LockKey is supplied the three default arguments, and the
  58. fourth, cPassword, is NIL.  This causes a prompt for the lockup password
  59. AND the unlock password  which must both be the same.
  60.  
  61. TO CALL DIRECTLY:
  62. -----------------
  63.  
  64. _LockKey('',0,'','PASSWORD')
  65.  
  66. or better yet:
  67.  
  68. _LockKey(,,,'PASSWORD')
  69.  
  70. Result: The three arguments for cProc, nLine and cVar receive either dummy
  71. or NIL arguments and the password 'PASSWORD' is supplied to the
  72. fourth parameter, cPassword.
  73.  
  74. No lockup password is prompted and an UNLOCK prompt is presented in which
  75. you must enter "PASSWORD" to unlock.
  76.  
  77. In EITHER case, cProc, nLine, and cVar are ignored.
  78.  
  79.  
  80. EXAMPLE:
  81.  
  82. _LockKey()
  83.  
  84. Result: The user is prompted for a password to lockup the keyboard with.
  85. A password prompt is presented and the same password must be re-entered
  86. to unlock the keyboard.
  87.  
  88. _LockKey('BUBBA')
  89.  
  90. Result: A password prompt is immediately presented and BUBBA must be entered
  91. to unlock the keyboard.  The user is not prompted to enter a password for
  92. unlock, but rather the password "BUBBA" is assumed.
  93.  
  94. ******************************************************************************/
  95.