# Coldfusion function help

**URL:** <https://forum.kirupa.com/t/coldfusion-function-help/295457>\
**Category:** programming\
**Created:** [August 30, 2009, 10:22pm UTC](https://forum.kirupa.com/t/coldfusion-function-help/295457 "2009-08-30T22:22:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzxjoanw](https://avatars.discourse-cdn.com/v4/letter/z/b5e925/32.png) [@zzxjoanw](https://forum.kirupa.com/u/zzxjoanw)\
**Post date:** [August 30, 2009, 10:22pm UTC](https://forum.kirupa.com/t/coldfusion-function-help/295457/1 "2009-08-30T22:22:47Z")

</div>

I have the following function:

```auto

<cfparam name="password" default="">

<cffunction name="passwordGen" returntype="string">
<cfloop index="loopCount" from="0" to="4">
<cfset passwordGen = #password# & #toString(RandRange(0,9))#>
</cfloop>
<cfreturn password>
</cffunction>

```

Currently it returns something along the lines of cfregister2ecfm1360396430$funcPASSWORDGEN@16c3ef9. What am I doing wrong?

Many thanks in advance.

Edit: I got it.
