O'Reilly logo

Special Edition Using Microsoft® Visual Basic® .NET by Jeff Spotts, Brian Siler

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

Working with Function Procedures

Function procedures are similar to sub procedures, with one key difference: They return a value. This means that somewhere in the body of the function procedure, a value will be calculated, retrieved, or otherwise created and set to be the function’s return value. This value can subsequently be used by the calling code; typically, it is assigned to a variable or used in expressions. Visual Basic offers a number of built-in functions that you can use, such as Val, which returns the numeric representation of a string, or Left, which returns a specified number of characters from the left end of a string. Function procedures let you build your own custom functions as well.

Building a Function

To build a function, ...

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