Reputation:
I have a problem with vb.net which I find kinda weird.
So I have this sub called NavigationWebURL which opens any url in your default browser.
NavigateWebURL("http://URLHERE.net/private.php?action=send&uid=2763296&subject=Application rating&message=I rate your Riptide application " + MetroTrackBar1.Value + " out of 100", "default")
But that gives me following error message:
Upvotes: 0
Views: 158
Reputation: 18310
And this is one of the very good reasons to why you should never use the plus sign (+
) to concatenate strings.
When you're concatenating strings with the plus sign and you include a number (Integer, Long, Double, Decimal, etc.) the compiler tries to add all the entries together as if the whole thing was a number.
Visual Basic has it's own concatenation operator (&
), which in my opinion should always be used with strings to avoid problems.
MetroTrackBar1.Value
is of a numeric type, which is why you get the error. To fix it, just replace the plus signs with concatenation operators.
NavigateWebURL("http://URLHERE.net/private.php?action=send&uid=2763296&subject=Application rating&message=I rate your Riptide application " & MetroTrackBar1.Value & " out of 100", "default")
Upvotes: 1