Subject Re: PasswordMaskEF.cc bug?
From Charlie <tm@tc.com>
Date Wed, 21 Feb 2024 10:21:56 -0500
Newsgroups dbase.getting-started

Lee...  I have tested it in several ways and it seems to be a fix!  Thanks so much!

Lee Grant Wrote:

> Ken,
>
> Okay, I think I got it right this time, but obviously someone else will
> have to test it to make sure I didn't short sight my goal, again. :(
>
> I added an else, for when the IsValidChar() was returned a false, and
> made that change the Key() variable of "returnValue" to false so it
> didn't write anything out. Here's the code I changed, after resetting
> the original returnValue to true, on initialization.
>
>              if CLASS::IsValidChar(enteredChar)    // Check if alphanumeric
>                 // if the text is not selected, insert the character
> entered,
>                 // if the text is selected, overwrite the characters
>                 // corresponding to the selection range with the character
>                 // entered
>                 if SelectStartPos == 0 AND SelectEndPos == 0
>                    this.enteredPassword = ;
>                       stuff(this.enteredPassword, nPosition, 1, enteredChar)
>                 else
>                    this.enteredPassword = ;
>                       stuff(this.enteredPassword, SelectStartPos + 1, ;
>                       SelectEndPos - SelectStartPos, enteredChar)
>                 endif
>                 returnValue = asc( this.maskChar ) // Output camouflage
> character
>                 else
>                 returnValue = false //This seems to have fixed the problem
>              endif
>
> Lee