All - I once came across an example that used the mod in an if then...

What I need is to:

if i = 100 or i = 200 or i = 300 or .... then
do my work
end if

i can be from 10 to 10,500, therefore the if would be long. How can I use
the mod to determine this by 100's? Or another way??

Thanks,
Brian

Re: MOD Operator by Jon

Jon
Sun Dec 05 14:13:29 CST 2004

Brian Hammer <bphammer@earthlink.net> wrote:
> All - I once came across an example that used the mod in an if then...
>
> What I need is to:
>
> if i = 100 or i = 200 or i = 300 or .... then
> do my work
> end if
>
> i can be from 10 to 10,500, therefore the if would be long. How can I use
> the mod to determine this by 100's? Or another way??

Not sure in what way this is related to Windows Forms - are you writing
in VB.NET? If so, I suggest you ask in the VB.NET group. (Effectively
you want if "i mod 100 = 0", but I don't know if that's exactly the
right syntax, not being a VB.NET programmer myself.)

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: MOD Operator by Herfried

Herfried
Sun Dec 05 15:04:57 CST 2004

"Jon Skeet [C# MVP]" <skeet@pobox.com> schrieb:
> Not sure in what way this is related to Windows Forms - are you writing
> in VB.NET? If so, I suggest you ask in the VB.NET group. (Effectively
> you want if "i mod 100 = 0", but I don't know if that's exactly the
> right syntax, not being a VB.NET programmer myself.)

Yep, that's the right syntax!

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Re: MOD Operator by Brian

Brian
Sun Dec 05 19:44:51 CST 2004

Only casue I was working with a form and updating some labels and text
boxes. :-)

Thanks for the code....

Brian

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1c1d7c40a476b9b898ba4e@msnews.microsoft.com...
> Brian Hammer <bphammer@earthlink.net> wrote:
>> All - I once came across an example that used the mod in an if then...
>>
>> What I need is to:
>>
>> if i = 100 or i = 200 or i = 300 or .... then
>> do my work
>> end if
>>
>> i can be from 10 to 10,500, therefore the if would be long. How can I use
>> the mod to determine this by 100's? Or another way??
>
> Not sure in what way this is related to Windows Forms - are you writing
> in VB.NET? If so, I suggest you ask in the VB.NET group. (Effectively
> you want if "i mod 100 = 0", but I don't know if that's exactly the
> right syntax, not being a VB.NET programmer myself.)
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Re: MOD Operator by Lars

Lars
Mon Dec 13 00:44:43 CST 2004


If yourValue Mod 100 = 0 Then

Debug.Write("Määäh") ' Do stupid stuff for testing.

End If

if your value is 100, 200 .... 10000000 then it will happen what you want :)

if your value is 100,1482 ... the result of MOD will be 0,1482
if your value is 215,1482 ... the result of MOD will be 15,1482



Brian Hammer wrote:
> All - I once came across an example that used the mod in an if then...
>
> What I need is to:
>
> if i = 100 or i = 200 or i = 300 or .... then
> do my work
> end if
>
> i can be from 10 to 10,500, therefore the if would be long. How can I use
> the mod to determine this by 100's? Or another way??
>
> Thanks,
> Brian
>
>
>
>