Hmm, seems to have something to do with the fact that the one record that wasn't appearing didn't have an image (exactly what isn't obvious).
which is actually a feature, not a bug, 'cause I want all the ed's picks to have images... the application is smarter than the person who wrote it! ;-) many thanks, Ian W ----- Original Message ----- From: "Paul Johnston" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 25, 2003 11:31 AM Subject: RE: [ cf-dev ] odd... > > 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] > -- ** 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]
