Imagine, you want to store user password to access external NAV portal, and no one must see it.
You can, of course, set the property to PasswordText = Yes on the form. But, what if the user press Ctrl + F8 to view fields inside the table? ...
So, let's write a little function to store protected password text.
Password - OnValidate()
Password := EncodeDecode(Password);
EncodeDecode(String : Text[30]) : Text[30]
FOR i := 1 TO STRLEN(String) DO
BEGIN
Ch := String[i];
Pass[i] := 255-Ch;
END;
EXIT(Pass);
So, you can use this function not only for encoding text, but also for decoding.
You can, of course, set the property to PasswordText = Yes on the form. But, what if the user press Ctrl + F8 to view fields inside the table? ...
So, let's write a little function to store protected password text.
Password - OnValidate()
Password := EncodeDecode(Password);
EncodeDecode(String : Text[30]) : Text[30]
FOR i := 1 TO STRLEN(String) DO
BEGIN
Ch := String[i];
Pass[i] := 255-Ch;
END;
EXIT(Pass);
So, you can use this function not only for encoding text, but also for decoding.