Monday June 23, 2008 9:35 PM
Word Count: 305
Every since watching Elliott Sprehn's presentation on the "Internals of the Adobe CF Server" presentation at CFUnited I have become a curious hunter. Today I was playing around with the page context and I found a cool little gem. So everyone has probably needed a random number at some time for whatever reason and you have probably turned to the built in ColdFusion function randRange. While this works great and I am not certain and this is just a guess but I would think that uses
java.util.random class in Java. Today I found out that that class is already available to you as part of the page context. The cool thing is there are some other methods in there that could be a big help to you. If you have ever needed a random boolean this is perfect for you. So here is a little code you can play with and the dump of the random class. Of course you could already do this by invoking the java class but why do it if its already there. If you want to learn more about the different methods just check out the api.