FUNCTION Scramble (tcStr) LOCAL lnI, lcRet, lnPos, lnLen lnLen = Len(tcStr) * Fill the result string with characters that cannot appear in the source string lcRet = REPLICATE(Chr(255), lnLen) =Rand(-1) * Take characters one by one from the source string * and place randomly into the result string FOR lnI =1 TO lnLen DO WHILE .T. lnPos = RandInt(1, lnLen) * If randomly selected position is filled already, try again IF Substr( lcRet, lnPos ) = Chr(255) lcRet = Stuff( lcRet, lnPos, 1, Substr(tcStr, lnI,1) ) EXIT ENDIF ENDDO ENDFOR RETURN lcRet FUNCTION RandInt(tnLower, tnUpper) RETURN INT((tnUpper - tnLower + 1) * RAND( ) + tnLower)>I was hoping to find a pre-existing function in VFP that would have functionality along the lines of: