Function() as type / end function – BrightSign BrightScript 3.0 Reference Manual User Manual
Page 48

43
endif
goto vp_msg_loop
Function() As Type / End Function
Function name(parameter As Type, …) As Type
Note: Each function has its own scope.
A function is declared using the
Function() statement. The parentheses may contain one or more optional parameters;
parameters can also have default values and expressions.
The type of each parameter may be declared. The return type of the function may also be declared. If a parameter type or
return type is not declared, it is Dynamic by default. Intrinsic types are passed by value (and a copy is made), while
objects are passed by reference. The
Sub statement can be used instead of Function as a shortcut for creating a
function with return type Void.
A parameter can be one of the following types:
•
Integer
•
Float
•
Double
•
String
•
Object
•
Dynamic
The function return can be one of the following types:
•
Void