View Single Post
  #3  
Old 08-18-2008, 01:04 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by napo_p2p View Post
If I remember correctly, random(start, end) will only return a random number within [start, end)

It's a bit different to generate a random character. Here's one way to generate a random upper-case letter:
PHP Code:
char(int(random(6591))); 
You can look at an ascii table to see where I get the 65 and 91 from. You could also look at an ascii table to get the ranges for lower-case letters.

Or, you could predefine an array of all the characters you want to include in your random strings, then use randomstring().
Example:
PHP Code:
temp.chars = {"A""B""C""D""a"123};  //Put all characters in here.
temp.confCode randomstring(temp.chars) @ randomstring(temp.chars) @ randomstring(temp.chars); 
And, to save as a log/*.txt file you can use savelog2
Example:
PHP Code:
savelog2("snaps.txt""The boy bought the basketball"); 
Ah, thanks a lot
++rep if i could. gotta spread

edit: I did temp.confCode=randomString(this.beg) etc., and it didn't work.
It shows up as blank in the GUI.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote