home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / PASSCHK.PRG < prev    next >
Encoding:
Text File  |  1991-05-20  |  1.1 KB  |  42 lines

  1. /*
  2.    Program: PASS_CHK()
  3.    System: GRUMPFISH LIBRARY
  4.    Author: Greg Lief
  5.    Copyright (c) 1988-90, Greg Lief
  6.    Clipper 5.01 version
  7.    Compile instructions: clipper passchk /n/w/a
  8.    Generic password checking utility
  9. */
  10.  
  11. //───── begin preprocessor directives
  12.  
  13. #include "grump.ch"
  14.  
  15. //───── end preprocessor directives
  16.  
  17.  
  18. function Pass_Chk(password, nrow)
  19. local mpass := space(len(password)), ret_val := .t.
  20. local wid := int((maxcol() - 3 - (16 + len(mpass))) / 2), getlist := {}
  21. local oldscore := set(_SET_SCOREBOARD, .F.), oldscrn
  22. default nrow to 12
  23. nrow := min(nrow, maxrow() - 3)
  24. gfsaveenv()
  25. colorset(C_MESSAGE)
  26. oldscrn := shadowbox(nrow - 1, wid, nrow + 1, 79-wid, 4)
  27. @ nrow, wid + 2 ssay 'Enter password:'
  28. @ nrow, col() + 1 get mpass color ',n/n'
  29. read
  30. byebyebox(oldscrn)
  31. gfrestenv()
  32. if ! ( ret_val := (upper(mpass) == upper(password)) )
  33.    err_msg('Invalid password')
  34. endif
  35. set(_SET_SCOREBOARD, oldscore)
  36. return ret_val
  37.  
  38. * end function Pass_Chk()
  39. *--------------------------------------------------------------------*
  40.  
  41. * eof passchk.prg
  42.