Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / VB / VB.net - WRAP( ) Equivalent in VB.Net

Author
Message
Epimetheus
22
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Naples, Florida
Posted: 16th Jun 2013 10:56 Edited at: 17th Jun 2013 02:02
DBPro has a command called Wrap which comes in handy when you constantly want to cycle a variable:



I know you can do this in VB.Net with something like:



But I wonder if there is some handy command in VB.Net which can do that automatically and keep my code clean. Thread synchronization would be nice too. Anyone know about something like this?
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 21st Jun 2013 08:06
In C we use the '%' which is the symbol for modulus. (the remainder of a division) ie x = 370 % 10; would give 10.

So I found VB.NET's version, the same command as in DBP too. http://msdn.microsoft.com/en-us/library/se0w9esz(v=vs.80).aspx

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Jun 2013 10:59
Quote: " (the remainder of a division) ie x = 370 % 10; would give 10."

I think 370 % 10 gives 0.

WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 25th Jun 2013 11:26
Whoops...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Login to post a reply

Server time is: 2026-06-10 09:31:47
Your offset time is: 2026-06-10 09:31:47