Return values

<< Click to Display Table of Contents >>

Navigation:  Explain™ Control Language  > Explain™ fundamentals >

Return values

Description

A function returns the value and type of the last expression evaluated. Functions always have a return value, although it may not be meaningful. Use the return statement to terminate the function before its last statement, e.g.:

 

if ( A lt B )

         A

         return

 A = A * B

 

If the test is true, data type and value of A are returned immediately; the next statement is never executed. Note that we do not use the C syntax, such as return A.

 

Make assignments from the results of function evaluations:

 

Count = Show(A,B)

 

Whatever Show returns—both type and value—become the type and value of Count.

 

Related Topics