Click to See Complete Forum and Search --> : Paging Function


Nicodemas
09-23-2005, 10:36 AM
I think I have found an error in IIS, but I'm not sure. Maybe I've just been staring at this code for too long ...

I've attached a text file containing the sub procedure that pages data from a 2d array. However there is one offending section of code that should be working, but isn't!

It is a conditional statement. Based on the arguments that I've passed, this is the conditional:

iTotalPages = 13
iCurrentPage = 13
PAGE_BUFFER = 2


if iTotalPages <= (iCurrentPage + PAGE_BUFFER) then
toNumber = iTotalPages
else
toNumber = (iCurrentPage + PAGE_BUFFER)
end if


The statement evaluates to true, but the variable "toNumber" still sets itself to 15!

Nicodemas
09-23-2005, 02:24 PM
Got it.

Data types somehow lost in the translation. I explicitly defined the datatype around both sides of the equation and it worked correctly.