[thelist] Cold fusion custom tags

ted serbinski tss24 at cornell.edu
Thu Jan 24 00:49:57 CST 2002


Well I have yet another question with cold fusion, custom tags. I'm
trying to create my own random password generator (the script works
great, if you want the code to it lemme know) but the reusability part
of it isn't so great.

I tried including this file in a loop, but each time it produced the
same random password. I figured it cached the page and that is why. So I
thought, what if I make a custom tag where I can send in a different
seed to get different results.

That should work, right? Well for some reason I can't get it to work.

The calling part:
 <cf_passwordGenerator todayDate=now()>

The part being called:
  <cfparam name="todayDate">
  <cfset seed="#DatePart("w", todayDate)##DatePart("ww",
todayDate)##DatePart("h", todayDate)#
     #DatePart("n", todayDate)##DatePart("s", todayDate)#">

The return part:
  <cfset caller.password=ArrayToList(passArray,'')>

I just want to send in the current date, than take that date and put it
into my seed value, which is just the various parts of the date strung
together.

The error I get is:
  The required parameter todayDate was not provided.
  This page uses the CFPARAM tag to declare the parameter 'todayDate' as
required for this template. The parameter is not 
  available. 

Any ideas? Something I'm missing? Thanks.

ted






More information about the thelist mailing list