I had a bug on an asp paging routine and figured out it was due to a value of a vbscript CInt variable exceeding 32,767. I tried to change the CInt to Clng but I get the infamous http 500 error so I'm doing something wrong.
I changed CInt(glIntTotalRecCnt) to Clng(glIntTotalRecCnt) below but it's not working.
I've never worked w/cint and clng before and I'd appreciate any help. Thanks.
----------------------
Here's the code:
Sub writeNavigationLinks(pPgNbr)
Response.Write("in writenavigationlinks <br>"
Response.Write ("glintototalreccnt = " & glIntTotalRecCnt & "<br>"
Response.Write ("glIntPgSize = " & glIntPgSize & "<br>"
' Display Page navigation links only if records are more than pagesize
'kcs changed cint to clng 7/29
'If CInt(glIntTotalRecCnt) > CInt(glIntPgSize) Then
If Clng(glIntTotalRecCnt) > CInt(glIntPgSize) Then
Dim strF, strP, strN, strL
strF = "<a href=javascript:naviTo('F')><font color='blue'>First</font></a>"
strP = "<a href=javascript:naviTo('P')><font color='blue'>Previous</font></a>"
strN = "<a href=javascript:naviTo('N')><font color='blue'>Next</font></a>"
strL = "<a href=javascript:naviTo('L')><font color='blue'>Last</font></a>"
If pTxStatus <> "P" Then
Response.Write("<tr><td colspan='7'><font color='blue'><sup><b>*</b></sup></font> : <font size='-1'>Pending evaluation</font></td></tr>"
End If
Response.Write("<tr align='center'>"
If ppgNbr <= 1 Then 'First Page
Response.Write("<td align='left' colspan='3'> </td>"
Response.Write("<td align='right' colspan='3'>" & strN & " | " & strL & "</td>"
ElseIf ppgNbr = glIntNbrOfPages Then 'Last Page
Response.Write("<td align='left' colspan='3'>" & strF & " | " & strP & "</td>"
Response.Write("<td align='right' colspan='3'> </td>"
Else
Response.Write("<td align='left' colspan='3'>" & strF & " | " & strP & "</td>"
Response.Write("<td align='right' colspan='3'>" & strN & " | " & strL & "</td>"
'Response.Write(strF & " " & strP & " " & strN & " " & strL)
End If
'Response.Write("</td>"
Response.Write("</tr>"
End If
End Sub 'writeNavigationLinks
I changed CInt(glIntTotalRecCnt) to Clng(glIntTotalRecCnt) below but it's not working.
I've never worked w/cint and clng before and I'd appreciate any help. Thanks.
----------------------
Here's the code:
Sub writeNavigationLinks(pPgNbr)
Response.Write("in writenavigationlinks <br>"

Response.Write ("glintototalreccnt = " & glIntTotalRecCnt & "<br>"

Response.Write ("glIntPgSize = " & glIntPgSize & "<br>"

' Display Page navigation links only if records are more than pagesize
'kcs changed cint to clng 7/29
'If CInt(glIntTotalRecCnt) > CInt(glIntPgSize) Then
If Clng(glIntTotalRecCnt) > CInt(glIntPgSize) Then
Dim strF, strP, strN, strL
strF = "<a href=javascript:naviTo('F')><font color='blue'>First</font></a>"
strP = "<a href=javascript:naviTo('P')><font color='blue'>Previous</font></a>"
strN = "<a href=javascript:naviTo('N')><font color='blue'>Next</font></a>"
strL = "<a href=javascript:naviTo('L')><font color='blue'>Last</font></a>"
If pTxStatus <> "P" Then
Response.Write("<tr><td colspan='7'><font color='blue'><sup><b>*</b></sup></font> : <font size='-1'>Pending evaluation</font></td></tr>"

End If
Response.Write("<tr align='center'>"

If ppgNbr <= 1 Then 'First Page
Response.Write("<td align='left' colspan='3'> </td>"

Response.Write("<td align='right' colspan='3'>" & strN & " | " & strL & "</td>"

ElseIf ppgNbr = glIntNbrOfPages Then 'Last Page
Response.Write("<td align='left' colspan='3'>" & strF & " | " & strP & "</td>"

Response.Write("<td align='right' colspan='3'> </td>"

Else
Response.Write("<td align='left' colspan='3'>" & strF & " | " & strP & "</td>"

Response.Write("<td align='right' colspan='3'>" & strN & " | " & strL & "</td>"

'Response.Write(strF & " " & strP & " " & strN & " " & strL)
End If
'Response.Write("</td>"

Response.Write("</tr>"

End If
End Sub 'writeNavigationLinks