CFLib.org – Common Function Library Project

randomFirstName()

Last updated June 22, 2010

author

Matt Casey

Version: 1 | Requires: CF6 | Library: UtilityLib

Description:
Returns a first name from an internal list of 100. Stupidly simple, but very handy for filling test datasets. Names were taken from Facebooks top 100

Return Values:
Returns a string.

Example:

<cfoutput>#randomfirstName()#</cfoutput>

Parameters:

No arguments.

Full UDF Source:

<!---
 Returns a random first name.
 
 @return Returns a string. 
 @author Matt Casey (matt@digitalhappy.com) 
 @version 1, June 22, 2010 
--->
<cffunction name="randomFirstName" output="false" access="public" returntype="any" hint="">
	<cfset var names = "Adam,Ahmed,Alex,Ali,Amanda,Amy,Andrea,Andrew,Andy,Angela,Anna,Anne,Anthony,Antonio,Ashley,Barbara,Ben,Bill,Bob,Brian,Carlos,Carol,Chris,Christian,Christine,Cindy,Claudia,Dan,Daniel,Dave,David,Debbie,Elizabeth,Eric,Gary,George,Heather,Jack,James,Jason,Jean,Jeff,Jennifer,Jessica,Jim,Joe,John,Jonathan,Jose,Juan,Julie,Karen,Kelly,Kevin,Kim,Laura,Linda,Lisa,Luis,Marco,Maria,Marie,Mark,Martin,Mary,Matt,Matthew,Melissa,Michael,Michelle,Mike,Mohamed,Monica,Nancy,Nick,Nicole,Patricia,Patrick,Paul,Peter,Rachel,Richard,Robert,Ryan,Sam,Sandra,Sara,Sarah,Scott,Sharon,Stephanie,Stephen,Steve,Steven,Susan,Thomas,Tim,Tom,Tony,William" />
	<cfreturn listGetAt(names, randRange(1,100)) />
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson