I had to convert some VB6 code to VB.net using the old VS2008 conversion tool. That tool helpfully inserts warning comments when it was not sure that the original & converted code was equivalent. One such example is:
UPGRADE_WARNING: Mod has a new behavior
Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
This ms-help://... "link" which as far as I can tell no longer functions. I was not able to find anything on the web referencing that link anymore either.
What is this warning actually referring to? What's the difference in the mod function?
First off, this explains the language change itself. Secondly addressing the point about the
ms-helplink.There is an explanation given on https://www.vbmigration.com/documentation/chapter3.aspx:
That same page goes on to suggestion that by adding a
CInt()call you can reproduce the original behavior, such as:This is corroborated by official VB documentation.
VB6:
(actually the VBA docs...)
VB.Net:
Note that the
ms-helplinks would actually work if you still have VS2008 installed. It brings up the built in local help GUI. Not sure when these links stopped working, but I think by at least VS2015 they did not.For this particular warning about
Modthe help system had this to say:IMHO this is NOT actually a very precise description of what is different. In particular, it does not sufficiently emphasize that the division result has been changed from always performing integer division. It only mentions about the return result being an integer.
The information above is more thorough.
For completeness, it also added: