home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxlogin.zip / rxlogin.cmd next >
OS/2 REXX Batch file  |  1993-09-08  |  2KB  |  95 lines

  1. /* A _very_ simple login batch file */
  2. CALL rxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  3. CALL SysLoadFuncs
  4.  
  5. SIGNAL ON HALT NAME NiceExit;
  6.  
  7. PARSE VALUE SysTextScreenSize() with height width
  8.  
  9. PARSE ARG checkpass
  10.  
  11. IF LENGTH(checkpass) > 0 THEN
  12.   DO
  13.     checkpass = INSERT(D2C(13), checkpass, LENGTH(checkpass))
  14.     PARSE VALUE SysCurPos() with row col
  15.     IF row >= (height-2) THEN
  16.       DO
  17.         SAY
  18.         SAY
  19.         row = height - 3
  20.       END
  21.     SIGNAL BreakFoil
  22.   END
  23.  
  24. SAY "What password should I use? ->"
  25. PARSE VALUE SysCurPos() with row col
  26. row = row - 1
  27. col = 30
  28. DO UNTIL (C2D(key) = 13) | (row = width)
  29.   PARSE VALUE SysCurPos(row, col) with x y
  30.   key = SysGetKey('NOECHO')
  31.   IF C2D(key) = 8 THEN
  32.     DO
  33.       IF col > 30 THEN
  34.         DO
  35.           col = col - 1
  36.           PARSE VALUE SysCurPos(row, col) with x y
  37.           SAY " "
  38.           checkpass = LEFT(checkpass, LENGTH(checkpass) - 1)
  39.         END
  40.     END
  41.   ELSE
  42.     DO
  43.       SAY "*"
  44.       checkpass = INSERT(key, checkpass, LENGTH(checkpass))
  45.       col = col + 1
  46.     END
  47. END
  48.  
  49. SAY "Machine now locked."
  50.  
  51. row = row + 2
  52. IF row >= (height-1) THEN
  53.   DO
  54.     SAY
  55.     SAY
  56.     row = height - 3
  57.   END
  58.  
  59. BreakFoil:
  60. SIGNAL ON HALT NAME BreakFoil;
  61.  
  62. DO UNTIL password = checkpass
  63.   col = 28
  64.   PARSE VALUE SysCurPos(row, 0) with x y
  65.   SAY COPIES(' ',width)
  66.   PARSE VALUE SysCurPos(row, 0) with x y
  67.   SAY "Please enter the password ->"
  68.   password = ""
  69.   DO UNTIL (C2D(key) = 13) | (col = width)
  70.     PARSE VALUE SysCurPos(row, col) with x y
  71.     key = SysGetKey('NOECHO')
  72.  
  73.     IF C2D(key) = 8 THEN
  74.       DO
  75.         IF col > 28 THEN
  76.           DO
  77.             col = col - 1
  78.             PARSE VALUE SysCurPos(row, col) with x y
  79.             SAY " "
  80.             password = LEFT(password, LENGTH(password) - 1)
  81.           END
  82.       END
  83.     ELSE
  84.       DO
  85.         SAY "*"
  86.         password = INSERT(key, password, LENGTH(password))
  87.         col = col + 1
  88.       END
  89.   END
  90. END
  91.  
  92. NiceExit:
  93. SAY
  94. SAY "Yet another Digital Production."
  95.