09-13-2003, 03:42 AM
Pages: 1 2
09-13-2003, 03:53 AM
Use INKEY$.
09-13-2003, 04:16 AM
Code:
CLS
b$ = ""
y = 1
LOCATE y
PRINT "_"
DO
a$ = ""
WHILE a$ = ""
a$ = INKEY$
WEND
SELECT CASE a$
CASE CHR$(13)
EXIT DO
CASE CHR$(27)
b$ = ""
CASE CHR$(8)
IF b$ = "" THEN
BEEP
ELSE
b$ = MID$(b$, 1, LEN(b$) - 1)
END IF
CASE ELSE
b$ = b$ + a$
END SELECT
LOCATE y
PRINT STRING$(LEN(b$), "*"); "_"; SPACE$(78 - LEN(b$))
LOOP
09-13-2003, 04:20 AM
This problem has been done so many times now... I even held a challenge here to simulate a password thing (which I think Meg won with a "matrix" password thing). Check the challenge thread for all the problems you could have with password things, and the solutions people came up with
09-13-2003, 04:22 AM
flex: Your code only prints the letter typed to make it print '*' you need this
Code:
CLS
b$ = ""
y = 1
DO
a$ = ""
WHILE a$ = ""
a$ = INKEY$
WEND
SELECT CASE a$
CASE CHR$(13)
EXIT DO
CASE CHR$(27)
b$ = ""
CASE CHR$(8)
IF b$ = "" THEN
BEEP
ELSE
b$ = MID$(b$, 1, LEN(b$) - 1)
END IF
CASE ELSE
b$ = b$ + "*"
c$ = c$ + a$
END SELECT
LOCATE y: PRINT b$; SPACE$(80 - LEN(b$))
LOOP
PRINT c$
09-13-2003, 04:27 AM
i edited my code just to add a cursor marker... but come on, if you can't see why my code is fine... then you need some professional help
[Flexibal>
[Flexibal>
09-13-2003, 04:34 AM
Quote:i edited my code just to add a cursor marker... but come on, if you can't see why my code is fine... then you need some professional helpoh. nvm. yours is still better
[Flexibal>
09-13-2003, 04:39 AM
*flattered*
:bounce:
[Flexibal>
:bounce:
[Flexibal>
09-13-2003, 05:53 AM
thx
09-13-2003, 11:32 AM
Here's another one: (submitted to Q-Tech by Zack)
Code:
CLS
PRINT "Enter Password: ";
row = 1
col = 17
LOCATE row, col
DO
press$ = INKEY$
IF press$ <> "" AND press$ <> CHR$(8) THEN
IF press$ = CHR$(13) THEN EXIT DO
LOCATE row, col
PRINT "*";
pswd$ = pswd$ + press$
col = col + 1
LOCATE row, col
END IF
IF press$ = CHR$(8) AND col - 1 >= 17 THEN
a$ = LEFT$(pswd$, LEN(pswd$) - 1)
col = col - 1
LOCATE row, col: PRINT " ";
pswd$ = a$
END IF
LOOP
Pages: 1 2