Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Subroutine Declaration Incorrectly Allows Return Type to be Defined

A subroutine is defined as a function shortcut which returns type void, by either explicitly calling, “return“ or not including a return. The BrightScript subroutine incorrectly allows a subroutine to declare a return type allowing the subroutine to compile. A subroutine can “return” or not include a return, but if a subroutine should return a variable, we recommend declaring a function with a return type.

See Program Statements | ProgramStatements-Function()AsType/EndFunction for more information about subroutines and functions. It correctly mentions that a subroutine only returns a void type (“The {{Sub}} statement can be used instead of {{Function}} as a shortcut for creating a function with return type Void").

ON THIS PAGE






  • No labels