Hello list,

I have two pieces of code and I can't figure out why one works and the other
does not.  The regular markup works perfect, so I thought I would move it to
CFSCRIPT, which is normally not a problem, but on barely 3 hours of sleep
it's one today... anyway here they both are followed by the error:

THIS WORKS:
<cfloop from="1" to="#arraylen(holderary)#" index="i">
        <!--- Check our date to make sure we are working on the right date
--->
        <cfif dateformat(createodbcdate(now()) ,"m/dd/yy") lte
dateformat(holderary[i][1] ,"m/dd/yy")>
                <cfif dateformat(createodbcdate(now()) ,"m/dd/yy") eq
dateformat(holderary[i][1] ,"m/dd/yy")>
                        <!--- Now we loop over our times list so we can
compare it to the current time --->
                        <cfset loopto =
(holderary[i][2]-1)+listlen(holderary[i][3],"|")>
                        <cfset cnt = 1>
                        <cfloop from="#holderary[i][2]#" to="#loopto#"
index="ii">
                                <cfif newtime lte listgetat(holderary[i][3],
cnt, "|")>
                                        <cfset cnt = cnt + 1>
                                        <cfset asxnum = ii-1>
                                        <cfbreak>
                                <cfelse>
                                        <cfset cnt = cnt + 1>
                                        <cfset asxnum = ii>
                                </cfif>
                        </cfloop>
                </cfif>
        </cfif>
</cfloop>



THIS BLOWS:
loopCnt = arraylen(holderary);
for (i = 1; i lte loopCnt; i = i + 1){
        if (dateformat(createodbcdate(now()) ,"m/dd/yy") lte
dateformat(holderary[i][1] ,"m/dd/yy")){
                if (dateformat(createodbcdate(now()) ,"m/dd/yy") eq
dateformat(holderary[i][1] ,"m/dd/yy")){
                        loopto = (holderary[i][2]-1) +
listlen(holderary[i][3],"|");
                        loopst = holderary[i][2];
                        cnt = 1;
                        for (ii = loopst; ii lte loopto; ii + 1){
                                if (newtime lte listgetat(holderary[i][3],
cnt, "|")){
                                        cnt = cnt + 1;
                                        asxnum = ii-1;
                                        break;
                                } else {
                                        cnt = cnt + 1;
                                        asxnum = ii;
                                }
                        }
                }
        }
}



THIS IS THE ERROR:
In function ListGetAt(list, index [, delimiters]) the value of index, which
is 4, is not a valid index for the list given as a the first argument (this
list has 3 elements). Valid indexes are in the range 1 through the number of
elements in the list

Any idea what gives?

Thanks,
Bill K.



______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to