|
ExitFunction | ||
Function <.FuncName.>[(ParamList)] ... [ExitFunction] ... EndFunction | ||
Parameters: NONE | ||
Returns: NONE | ||
Functions can be called from different locations in a program. A function is a routine that returns a value after it executes. For example: calls MyFunction and assigns the result to I. Function calls cannot appear on the left side of an assignment statement. Functions that don't return data (values / strings or arrays) can be used as complete statements. For example, calls the MyOtherFunction routine. A function is declared with the Function keyword, followed by the function name and a list of optional parameters (seperated my commas). The function ends with the EndFunction statement that can be followed by a value or expression that will be returned. With ExitFunction you can exit a function anywhere in the function block. FACTS: * ExitFunction can only be used from within a function block, and doesn't work from within protected subroutines (Psub/EndPsub block). * Any return data (values/strings or arrays) that follow ExitFunction must be of the same type and number of those following the EndFunction statement. * You can return multiple values from a function using ExitFunction, but the number of parameters following the ExitFunction statement. * See the Functions&PSub tutorial in the About section of the help for more details Mini Tutorial:
This example would output.
|
Related Info: | EndFunction | Function | Functions&Psub | Psub : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |