dizietemblesssma Posted September 28, 2021 Share Posted September 28, 2021 If I have nested functions: Function someFunction() someOtherFunction() some_stuff.. EndFunction Function someOtherFunction() some_more_stuff.. Return EndFunctionwill the Return statement exit out of someFunction() as well as someOtherFunction() or will someFunction still run 'some_stuff'? diziet Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 28, 2021 Share Posted September 28, 2021 Return tells papyrus to exit the current function and go back to where it was. In your example, the papyrus thread running someOtherFunction() will exit that function and go back to someFunction(). Note, putting return at the end of a function is pointless. Its purpose is to exit a function or event early if criteria are not met. Link to comment Share on other sites More sharing options...
dylbill Posted September 28, 2021 Share Posted September 28, 2021 IsharaMeradin Is correct. I would add that return is also used to get a value back from a function. Example: Function SomeFunction() Int TestInt = IntFunction() ;TestInt is 10 EndFunction Int Function IntFunction() Return 10 EndFunction Link to comment Share on other sites More sharing options...
dizietemblesssma Posted September 29, 2021 Author Share Posted September 29, 2021 I get the use of the return statement:) I was just quickly ruslting up an example of my query, which has been answered. In the way i wanted too:) diziet Link to comment Share on other sites More sharing options...
Recommended Posts