
Password porgram for QB 4.5
'Rundown of Parameters:
'FUNCTION GetInput$ (Row, Col, Prompt$, Default$, MaxLen, BlankBlock, PWord$,)
'
' Row - Integer; row on screen
' Col - Integer; column on screen
' Prompt$ - String; Prompt string (ex. "What is the password?")
' Default$ String; defaulted text (ex. "pass" [for the password])
' MaxLen - Integer; maximum length of string
' MinLen - Integer; minimum length of the string
' BlankBlock - String; character used for unused field spaces
' PWord - String; contains NULL if not password, else is used as special
' blanking character
' KeyMask - String; contains a list of allowable chars, all else are ignored
DEFINT A-Z
DECLARE FUNCTION GetInput$ (Row%, Col%, Prompt$, Default$, MaxLen%, MinLen%, BlankBlock$, PWord$, Limit$)
CLS
Name$ = GetInput$(1, 1, "Name ======> ", "Joel Caturia", 15, 1, "*", "", "")
password$ = GetInput$(2, 1, "Password ==> ", "Joel Caturia", 15, 1, "*", "*", "")
DateTemp$ = GetInput$(3, 1, "Date ==> ", DATE$, 10, 10, "*", "", "1234567890-")
TimeTemp$ = GetInput$(4, 1, "Time ==> ", TIME$, 8, 8, "*", "", "1234567890:")
PRINT
PRINT "Name ========> "; Name$
PRINT "Password ====> "; password$
PRINT "Date ==> "; DateTemp$
PRINT "Time ==> "; TimeTemp$
FUNCTION GetInput$ (Row, Col, Prompt$, Default$, MaxLen, MinLen, BlankBlock$, PWord$, Limit$)
'**********************************************************
' FUNCTION GetInput$ () - the SMART input routine created
' by Corey S. Seliger
' HEAVILY MODIFIED BY JOEL CATURIA
' And Kevin Becker
'
' This FUNCTION is the replacement for QuickBASIC's INPUT
' routine. This routine allows you to have values already
' set so the user just has to go back and change a part of
' it, instead of having to reenter what goes into the
' field.
'
' **********************************************************
DO
LOCATE Row, Col + LEN(Prompt$): PRINT STRING$(MaxLen, BlankBlock$);
LOCATE Row, Col, 1, 10, 11
PRINT Prompt$;
Default$ = LTRIM$(RTRIM$(Default$))
IF Default$ = STRING$(LEN(Default$), 0) THEN Default$ = ""
IF LEN(Default$) <> 0 THEN
LOCATE Row, Col + LEN(Prompt$): PRINT Default$;
Queue$ = Default$
LOCATE Row, Col + (LEN(Prompt$) + LEN(Default$))
END IF
Start: ' Added by KB
DO
Tmp$ = INKEY$
IF Tmp$ <> "" THEN
IF Tmp$ = CHR$(13) THEN
Tmp$ = ""
PRINT
EXIT DO
ELSEIF Tmp$ = CHR$(8) THEN
Tmp$ = ""
IF LEN(Queue$) >= 1 THEN
LOCATE , POS(0) - 1: PRINT BlankBlock$; : LOCATE , POS(0) - 1
Queue$ = LEFT$(Queue$, LEN(Queue$) - 1)
ELSE
SOUND 500, 1
WHILE INKEY$ <> "": WEND
END IF
ELSEIF LEN(Tmp$) > 1 THEN
SOUND 500, 1
WHILE INKEY$ <> "": WEND
Tmp$ = ""
ELSEIF ASC(Tmp$) < 32 OR ASC(Tmp$) > 126 THEN
SOUND 500, 1
WHILE INKEY$ <> "": WEND
Tmp$ = ""
' ***
' Put any other special cases before these lines!!!
' ***
ELSEIF LEN(Queue$) < MaxLen THEN
IF Limit$ <> "" THEN ' Added by KB
IF NOT INSTR(Limit$, Tmp$) <> 0 THEN GOTO Start ' Added by KB
END IF ' Added by KB
Queue$ = Queue$ + Tmp$
IF PWord$ = "" THEN
PRINT Tmp$;
ELSE
PRINT PWord$;
END IF
ELSE
SOUND 500, 1
WHILE INKEY$ <> "": WEND
Tmp$ = ""
END IF
END IF
LOOP
IF LEN(Queue$) >= MinLen% THEN
EXIT DO
ELSE
SOUND 500, 1
END IF
LOOP
GetInput$ = Queue$
LOCATE , , 0
END FUNCTION
'-----------------------8<--------------
I got this from th FIDO QuickBasaic sub
PAX,
TCF
Too Cool Fool 03-25-96 John Rodgers
"Politics": from poli = many, tics = {*filter*}-sucking parasites
http://www.*-*-*.com/ ~coolfool/wiz/