Return Statement
From NWN Lexicon
Jump to navigationJump to searchreturn Statement
When the return statement is reached within a function it will halt execution and pass the return value to the code block which initially made the function call. If the value being returned does not match the data type of the function, then the compiler will throw a type mismatched error. In the case of void functions, return statements are optional, but can still be used to prematurely halt execution, however if a value is specified after return the compiler will throw a type mismatched error.
void function return example usage:
author: Ryan Hunt, editor: Charles Feduke