Alltrim() don't work (from comp.databases.xbase.fox)
Florin,
The problem is that you are adding CHR(0) in your program in line :
thisform.cpassword=thisform.cpassword+chr(val(substr(thisform.npasswor
d,2*i-1,2)))
ALLTRIM() doesn't remove CHR(0) but will remove CHR(32).
I wish I could give you a better explanation of exactly what CHR(0) is
or why it's different from CHR(32), but I haven't found it yet.
I see that you are making an effort to "encrypt" the passwords. You
might look at SYS(2007) which is a checksum. It returns a 5-character
string of digits. You could store VAL(SYS(2007, UPPER("MARIAN "))
or something like that.
There is a nice encryption routine available at
http://www.*-*-*.com/
(free.)
--
Cindy Winegarden
Microsoft Certified Professional, Visual FoxPro
Duke Children's Information Systems
Duke University Medical Center
| Hi,
| I created a form to be used at login, where the user enters name and
| password.
| The problem appears (see the Click event of <OK> button) when I
compare the
| string entered by the user (thisform.tpass.value) with the string
obtained
| from the table where the names and pass are kept
(thisform.cpassword). I do
| not know why the ALLTRIM is not performed for THISFORM.CPASSWORD!!!
| To try, please input HELEN for user name and MARIAN for password.
You will
| see (in de{*filter*} for example) that it do not remove the trailing
blanks, so
| the comparison fails.
| I will attach a zip archive containing the form and the password
table
| (where the pass is kept using ASCII codes, that will be converted in
the
| valid clause of the pass textbox).
|
| Can anybody tell me that's wrong?
|
| Thank you,
| Florin Cherbis
|
|
|