> How about this quick fix: > > <cfset randpick = ListGetAt(list, place)> > > <cfif variables.randpick EQ 0> > <cfset randpick = ListGetAt(list, place)> > </cfif>
Could still produce 0 twice... > <cfquery datasource="#dsn#" name="pickids"> > SELECT id > FROM diary > WHERE edpick = 'yes' > </cfquery> > > <cfset list = valuelist(pickids.id)> > <cfset picklist = ListLen(list)> > <cfset place = randRange(1,picklist)> > <cfset randpick = ListGetAt(list, place)> The randrange cannot produce less than 1, so you have to assume that the error occurs before that. In other words, randrange is producing 0 for the place variable. This can only occur if picklist is 0 and therefore if the pickids query has NO records returned... Maybe check the DSN connection? Paul -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
