* FUNCTION GenPass(tnLargo) *------------------------------------------------ * Generate a random password * it will contain UpperCase, Lowercase, numbers * and special characters. * numeros * PARAMETERS: tnLargo: len of the password * RETURNS: Character * USE: ? GenPass(15) *------------------------------------------------ FUNCTION GenPass(tnLargo) IF EMPTY(tnLargo) tnLargo = 10 ENDIF LOCAL ln, lc, lnI *-- Caracteres que contendra la clave generada #DEFINE CARACTERES "_0123456789ABCDEFGHYJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" RAND(-1) ln = LEN(CARACTERES) lc = "" FOR lnI = 1 TO tnLargo lc = lc + SUBSTR(CARACTERES, INT(RAND() * ln ) + 1, 1) ENDFOR RETURN lc ENDFUNC *------------------------------------------------HTH