Back to index

Return Statement
Returns control to the code that called a Function procedure.

Format:

   Return expr

Syntax:

Remarks:

1. Return is equivalent to assigning the expression to the function name as the return value and then executing an Exit Function statement.

See also:

- Function statement
- Exit statement

Example:

   Function GetAgePhrase(Age As Integer) As String
      If Age > 60 Then Return "Senior" EndIf
      If Age > 40 Then Return "Middle-aged" EndIf
      If Age > 20 Then Return "Adult" EndIf
      If Age > 12 Then Return "Teen-aged" EndIf
      If Age > 4 Then Return "School-aged" EndIf
      If Age > 1 Then Return "Toddler" EndIf
      Return "Infant"
   End Function


Copyright (c) 2000-2006 by Smartphoneware. All rights reserved.