O'Reilly logo

Start Here!™ Fundamentals of Microsoft® .NET Programming by Rod Stephens

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

Calling Routines

When a program invokes a routine, execution jumps from the calling code into the routine. The routine performs its task, and then execution returns to the point where the routine was called. Often, execution resumes with the calling code’s next statement, but sometimes, if the call to a routine is part of a complex statement, the same statement may continue to perform more tasks.

For example, if a program has defined the Factorial function described previously, then the following statement calculates 5! times 6!:

value = Factorial(5) * Factorial(6);

In this example, execution passes to the Factorial function to calculate 5!. When that function call returns, the code calls the function again to calculate 6!. When the second call returns, ...

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