Example now is 6/4/2009-4:51:37-PM I just want to get the 7 of the 37 as a random number. How to do it? Thanks,
What is the purpose of this? Why would you not just use the random number generator to generate a number between 0-9 ? But another way to do what you want (in asp.net) : <%= Right(Now.Second.ToString, 1) %> Code (markup):
Thanks again, Because, I am trying to make a random to go with time's parts so I can know the "when". My example question here http://forums.digitalpoint.com/showthread.php?p=11639417#post11639417 Hope you can me too. BTW, <%= Right(Now.Second.ToString, 1) %> It is not working and has an error appear. Regards,
If it's asp.net you may want to use the .NET methods for manipulating strings instead right/left and such.
function $random(min, max, radix){ if(radix){ // if radix>0, then generete string, that contains 0-9a-z(0-35) set by radix(1-35), from min len to max len r = radix; if(r<1)r=1; if(r>35)r=35; a = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; l=(min==max)?min:$random(min, max); s=''; for(var i=1;i<=l;i++){ s+=a[$random(0, r)]; } return s; }else{ // ToDO: use CryptGenRandom for true random return Math.floor(Math.random() * (max - min + 1) + min); } }
Because who are going to make increases in row three will be adding four stittches there are diffrent ways to make increases who can use the way use in pattem.