Didn't try it out ... contained a few errors... That code works fine:

<CFSCRIPT>
recordcount = 10;
iTotalImages = 5;
lstImageNames = ""; // Array holding image names
iRandTmp = 0;
for ( i=1; i LTE recordCount; i=i+1 ) {
  inserted = false;
  // Get an image number
  while( NOT inserted ) {
    iRandTmp = int( randRange( 1, recordCount ) ) ;
    if ( iRandTmp GT iTotalImages ) {
      iRandTmp = iRandTmp mod iTotalImages;
      lstImageNames = listAppend( lstImageNames , iRandTmp );
      inserted = true;
    }
    else if ( NOT listFind( lstImageNames, iRandTmp ) ) {
      lstImageNames = listAppend( lstImageNames , iRandTmp );
      inserted = true;
    }
  } // end while
  writeOutput( "<IMG SRC=""img#iRandTmp#"" ......><BR> " );
} // end for

</CFSCRIPT>

So did you figure out what was wrong? Btw, you had a spelling error in your
last message "iRandTemp" != iRandTmp.

Glad to help,

Marc Campeau
----------------------
Senior Software Engineer
Vertabase Pro - Project Management Tools
http://www.vertabasepro.com

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Marc Campeau" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to