FUNCTION IsStrongPassword( cStr ) > >LOCAL i, nDigitCount, nUpperCount, nLowerCount >STORE 0 TO nDigitCount, nUpperCount, nLowerCount >FOR i=1 TO LEN(cStr) > DO case > CASE ISDIGIT( SUBSTR(m.cStr,m.i)) > nDigitCount = nDigitCount + 1 > > CASE ISUPPER(SUBSTR(m.cStr,m.i)) > nUpperCount = nUpperCount + 1 > > CASE ISLOWER(SUBSTR(m.cStr,m.i)) > nLowerCount = nLowerCount + 1 > ENDCASE >ENDFOR > >RETURN LEN(m.cStr)>5 AND m.nUpperCount>0 AND m.nLowerCount>0How about something like this - might be faster than loops.
LPARAMETERS tcPwd LOCAL lcDigit, lcAlpha, llStrong llStrong = .F. lcDigit = "0123456789" lcAlpha = "abcdefghijklmnopqrstuvwxyz" IF LEN(tcPWd) > 5 AND ; LEN(tcPwd) <> LEN(CHRTRAN(tcPwd, lcDigit, "")) AND ; LEN(tcPwd) <> LEN(CHRTRAN(tcPwd, UPPER(lcAlpha), "")) AND ; LEN(tcPwd) <> LEN(CHRTRAN(tcPwd, LOWER(lcAlpha), "")) llStrong = .T. ENDIF RETURN llStrong