Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please, Need Help re: Cint vs Clng

Status
Not open for further replies.

Coder7

Programmer
Joined
Oct 29, 2002
Messages
224
Location
US
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(&quot;in writenavigationlinks <br>&quot;)
Response.Write (&quot;glintototalreccnt = &quot; & glIntTotalRecCnt & &quot;<br>&quot;)
Response.Write (&quot;glIntPgSize = &quot; & glIntPgSize & &quot;<br>&quot;)
' 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 = &quot;<a href=javascript:naviTo('F')><font color='blue'>First</font></a>&quot;
strP = &quot;<a href=javascript:naviTo('P')><font color='blue'>Previous</font></a>&quot;
strN = &quot;<a href=javascript:naviTo('N')><font color='blue'>Next</font></a>&quot;
strL = &quot;<a href=javascript:naviTo('L')><font color='blue'>Last</font></a>&quot;

If pTxStatus <> &quot;P&quot; Then
Response.Write(&quot;<tr><td colspan='7'><font color='blue'><sup><b>*</b></sup></font>&nbsp;:&nbsp;<font size='-1'>Pending evaluation</font></td></tr>&quot;)
End If
Response.Write(&quot;<tr align='center'>&quot;)
If ppgNbr <= 1 Then 'First Page
Response.Write(&quot;<td align='left' colspan='3'>&nbsp;</td>&quot;)
Response.Write(&quot;<td align='right' colspan='3'>&quot; & strN & &quot; | &quot; & strL & &quot;</td>&quot;)
ElseIf ppgNbr = glIntNbrOfPages Then 'Last Page
Response.Write(&quot;<td align='left' colspan='3'>&quot; & strF & &quot; | &quot; & strP & &quot;</td>&quot;)
Response.Write(&quot;<td align='right' colspan='3'>&nbsp;</td>&quot;)
Else
Response.Write(&quot;<td align='left' colspan='3'>&quot; & strF & &quot; | &quot; & strP & &quot;</td>&quot;)
Response.Write(&quot;<td align='right' colspan='3'>&quot; & strN & &quot; | &quot; & strL & &quot;</td>&quot;)
'Response.Write(strF & &quot; &quot; & strP & &quot; &quot; & strN & &quot; &quot; & strL)
End If
'Response.Write(&quot;</td>&quot;)
Response.Write(&quot;</tr>&quot;)
End If
End Sub 'writeNavigationLinks
 
how about cDbl()

____________________________________________________

onpnt2.gif

 
Thanks, onpnt! Cdbl works and this morning so did Clng. The site where our test application resides was having some problems yesterday and I think that's what caused the error, not the vbscript---welcome to web development HAHAHAHA.

Thanks, again. Have a great week!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top