O'Reilly logo

Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition by Harvey M. Deitel - Deitel & Associates, Inc., Paul J. Deitel - Deitel & Associates, Inc.

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

7.3. Subroutines: Methods That Do Not Return a Value

The programs presented earlier in the book each contain at least one method declaration that calls FCL methods (such as Console.WriteLine) to accomplish the program’s tasks. All of the methods that you have defined so far, such as DisplayMessage in class GradeBook, are known as subroutines—methods that perform tasks but do not return a value. Functions are methods that do return a value to the calling method. An example of a function that you have seen is Console.ReadLine, which returns to the caller the data entered by the user at the keyboard. We show how to declare functions in Section 7.4.

Consider the console application in Fig. 7.1, which uses a subroutine (invoked from the application’s ...

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