O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Problem Handling for Operator Procedures

When used correctly, operator procedures can make a developer’s life a lot easier. But at the same time, bear in mind that there are some situations where implementing operator procedures can cause errors.

Beware When Using Reference Types!

This chapter’s SuperString example added operator procedures to a structure, which is a value type. The operator procedures also accepted value types. Now take a closer look at one of the calculation operator procedures:

Public Shared Operator +(ByVal sstring1 As SuperString, ByVal sstring2 As SuperString) As
SuperString
    Return sstring1.Add(sstring2)
End Operator

Here, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required