mod

L

Laura K

I have a piece of code that I found to allow me to page through the
records in a datalist. For the most part I understand it but I am a bit
confused by the following.


tmpInt = CInt(intRecordCount.Text) Mod CInt(intPageSize.Text)

This is the in the code when the "last" link is clicked. What does Mod
refer to?

Any help appreciated!

Laura K

(below is the full code for the sub)
Public Sub ShowLast(ByVal s As Object, ByVal e As EventArgs)
Dim tmpInt As Integer

tmpInt = CInt(intRecordCount.Text) Mod CInt(intPageSize.Text)
If tmpInt > 0 Then
intCurrIndex.Text = CStr(CInt(intRecordCount.Text) -
tmpInt)
Else
intCurrIndex.Text = CStr(CInt(intRecordCount.Text) -
CInt(intPageSize.Text))
End If
Datastuff()

End Sub
 
C

Craig Deelsnyder

Laura said:
I have a piece of code that I found to allow me to page through the
records in a datalist. For the most part I understand it but I am a bit
confused by the following.


tmpInt = CInt(intRecordCount.Text) Mod CInt(intPageSize.Text)

This is the in the code when the "last" link is clicked. What does Mod
refer to?

Mod is an operator: divides two integers and returns the remainder (only):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vaoprmod.asp
 
L

Laura K

So is the value of tmpint the remainder of intRecordCount.text divided
by intPageSize.text?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top