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

Preparing a Structure or Class for Operator Procedures

The most important thing you need to know about operator procedures is that they are exclusively implemented as static functions. That’s because with many operators you must pass two arguments to the operator procedure. The following code line would also be possible without operators:

TypeInstance3 = TypeInstance1 + TypeInstance2

In that case, the line would look like this:

TypeInstance3 = TypeInstance.Add(TypeInstance1, TypeInstance2)

Therefore, when you look at the following code samples, keep in mind that implementing operator procedures is only one possible way to accomplish the goal (albeit a very practical one). Similarly, the code

Dim testString = "Klaus" testString = testString + " shows ...

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