Unicode Intrinsic Functions - IsValidPassword Method

Test whether the string contains a valid password

Member of Unicode Intrinsic Functions (PRIM_LIBI.IUnicodeIntrinsics)


NameTypeData TypeDescription
Result*Result (Optional)BooleanTrue if the string is a valid password
Strength*InputEnumerationSpecifies how strong the password needs to be


The isValidPassword method allows you test whether a string adheres to the selected password policy.

Allowed Values

Enum ValueDescription
MediumMinimum 6 characters with either, one uppercase and one lowercase, one lowercase and one numeric, or one upprecase and one numeric
StrongMinimum 8 characters with at least one uppercase, one lowercase, one number and one special character (@$!%*?&)


This example shows how password entry might be validated in the UI
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(528) Width(896) Theme(#SYS_THEME)
   Define_Com Class(#PRIM_MD.Edit) Name(#Password) DisplayPosition(1) Label('Password') Left(16) Parent(#COM_OWNER) TabPosition(1) Top(16) Width(473) PasswordChar('*')
   Evtroutine Handling(#Password.Changed)
      If (#Password.Value.IsValidPassword( Medium ))
         #Password.HelperText := "Medium"
      If (#Password.Value.IsValidPassword( Strong ))
         #Password.HelperText := "Strong"
      If ((*Not #Password.Value.IsValidPassword( Medium )) *And (*Not #Password.Value.IsValidPassword( Strong )))
         #Password.HelperText := "Password must be min at least 6 with one upper, one lower and one numeric"

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020