I'm a doctor, not a mechanic

Return statement

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 04:55, 31 October 2008 by Wormbo (Talk | contribs) (New page: The '''return''' statement immediately exits the current function or operator. No statement logically following a '''return''' will be executed anymore. In state code, the '''...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The return statement immediately exits the current function or operator. No statement logically following a return will be executed anymore.

In state code, the return statement is not allowed. You can use the stop statement or call GotoState(); instead, depending on the desired effect.

Syntax

For function without a return type, the syntax simply is:

return;

However, if the function declaration contains a return type, the following variation must be used instead:

return expression;

The expression's type must be compatible to the function's return type.