Qbasicnews.com

Full Version: Is there a code? (hiding passwords)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
when it asks you for a password...
i want it to print *astricks* not actual lettering...
is there coding for this?....
please help...
please don't capitalize all of the title :wink:


here:

[syntax="QBASIC"]DECLARE FUNCTION password$ (hide$, x!, y!)
CLS
PRINT password$("*", 1, 1)

FUNCTION password$ (hide$, x, y)
DO
press$ = INPUT$(1)
SELECT CASE press$
CASE CHR$(13): EXIT DO
CASE CHR$(8)
IF LEN(a$) > 0 THEN
LOCATE y, x: PRINT SPACE$(LEN(a$))
a$ = LEFT$(a$, LEN(a$) - 1)
b$ = LEFT$(a$, LEN(b$) - 1)
END IF
CASE ELSE: a$ = a$ + hide$: b$ = b$ + press$
END SELECT
LOCATE y, x: PRINT a$
LOOP
password$ = b$
END FUNCTION
[/syntax]

I just made it in like 3 minutes so if it blows up blame my phone.
the functions are wrong
What??? It's perfectly fine
Quote:What??? It's perfectly fine

Sounds like *somebody* is in denial...
Is it becuase I put LOCATE 1, 1 instead of LOCATE y, x? That's the only thing I can see???
It works perfectly, WT.