BS2 Keyboard Code
Archiver
Posts: 46,084
Okay, nobody bit before, so I'll rephrase the question...
Anybody got a compact routine in PBASIC for comparing 2 strings?
I need something to compare a string stored in EEPROM to see if there
is a password match. I get each character from the keypad by calling
my KeyScan routine as a subroutine.
Chris
Anybody got a compact routine in PBASIC for comparing 2 strings?
I need something to compare a string stored in EEPROM to see if there
is a password match. I get each character from the keypad by calling
my KeyScan routine as a subroutine.
Chris
Comments
>
>Anybody got a compact routine in PBASIC for comparing 2 strings?
>I need something to compare a string stored in EEPROM to see if there
>is a password match. I get each character from the keypad by calling
>my KeyScan routine as a subroutine.
>
>Chris
Something like this?,,,
i var nib
x var byte
char var byte
pw data "crab7zuni" ' password in eeprom
for i=0 to 8
gosub keboard ' get char
read pw+i,x ' get stored match
if char<>x then badpass ' exact match, case sensitive
next
goodpass:
' you're in!
' continue
goto top
badpass:
' mismatch, try again
goto top
> Something like this?,,,
> i var nib
> x var byte
> char var byte
Yes Tracy, something like that...I printed your
message...Will examine it more closely in a few, but
at first glance, it seems to do what I need, given a
single fixed-length password. Thanks.
Chris
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com