I have to bulid a function which generates a random 6 alpha-numeric password, 3xChar + 3xInt.
I havent got the faintest idea where to start! I have a table of passwords already assigned so if at all possible the function would be able to look at the list and find one that was not already assigned.
For all thous who may enquire as to the security level these passwords will be encrypted later on.
With that in mind, you could create a few functions, one that would return a random integer (most likely between 0 and 9, since you only need one numeric character). One that would return a random letter (using chr(number), where number = a random number between 65 and 122).
Then you could create a function that would randomly generate either a 1 or a 2, where 1 would call the random integer function, and 2 would call the random alpha function. You could loop through this for as many characters as you need, instant random password.
In your case, you could omit the last step, and use a loop that calls the random letter function 3x, then the random int function 3x.
Well, Rnd returns a number > 0, and < 1. So, Rnd * 26 Is going to give you a number between 1 and 26. You can omit the + 1 if 0 is acceptable. The + 64 is to bring you the specified lower bounds. Int will round the number up or down, and Chr returns the ascii for the number.
They key is in Rnd returning that value between 0 and 1, once you figure out how to use that, you're set.
No problem, I also got bored and decided to make this function myself, me thinx it will come in handy!! I neglected to account for the alpha gap in ASCII code, I really should mention that caps are between 65-90, and lower case is 97-122. Sorry about that.