Click here to Skip to main content
15,886,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I'm trying to get something working (Obviously) and I'm running into a bit of a snag, I'd like to do a simple:

VB
If (intNum1 % intNum2 = 0) Then
   'Do Something
End If

Nothing too out of the ordinary, just would like to be able to make it as simple as that without having to do other work for the same function.
Posted
Updated 19-Apr-11 11:18am
v2
Comments
Sandeep Mewara 19-Apr-11 14:38pm    
And your problem is?
MacRaider4 19-Apr-11 14:42pm    
There doesn't seem a be a % operator in VB.net thus the problem... or is there some other hidden vb function that we should know about?
Tarun.K.S 19-Apr-11 14:42pm    
use "mod" for visual basic.

 
Share this answer
 
Comments
MacRaider4 19-Apr-11 14:48pm    
I would have figured that out eventually (yeah right)... thanks guys, figured it was something stupid, but then again it is VB after all. And before I get pounded on for that, I started off in VB and used it for years, it's just been a while. Thanks again!!!
OriginalGriff 19-Apr-11 14:55pm    
Welcome!
Espen Harlinn 19-Apr-11 18:03pm    
There is always c# :-)
MacRaider4 20-Apr-11 6:52am    
I actually started it in C# as another portion of it (the project) that I have to do I already have a few classes that I could have used, but no... my boss wants it in VB (because he doesn't know C# and isn't up to learning it). So no I have to re-learn all the stuff I forgot from VB.
Manfred Rudolf Bihy 19-Apr-11 16:10pm    
Yep! 5+
If % operator mean modulo, then you can use mod function.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 19-Apr-11 16:10pm    
Correct! 5+
Espen Harlinn 19-Apr-11 18:01pm    
Right :)
AspDotNetDev 19-Apr-11 18:24pm    
It's technically the mod operator, not the mod function, but since you were the first to post, I gave you a 4.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900