What does the "return" command do?

Post » Thu Jul 17, 2014 6:07 pm

Sample script

Begin Gamemode

if {condition}

return

else

{do something}

endif

End

What does return do? Does it drop to the endif, or the End, or exit the script entirely? I've done some searches and can't find any information. I've seen this command used in many scripts and can't quite figure out exactly what it does.

Help? Please? :D

User avatar
Cedric Pearson
 
Posts: 3487
Joined: Fri Sep 28, 2007 9:39 pm

Post » Thu Jul 17, 2014 5:02 am

You know I'm not real sure what the return command does either .

But to me it says ... return to the line from whence it came.

So in your case it says :

Return to check this line "if {condition}

There is definitely needs to recheck functions without waiting for the engine tick.

Return facilitates that ... Imho

User avatar
ImmaTakeYour
 
Posts: 3383
Joined: Mon Sep 03, 2007 12:45 pm


Return to Fallout: New Vegas