<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.herc.ws/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Return</id>
		<title>Return - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Return"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Return&amp;action=history"/>
		<updated>2026-05-05T03:27:15Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Return&amp;diff=466&amp;oldid=prev</id>
		<title>Via: Created page with &quot;==Syntax== *'''return''' [&lt;return value&gt;];  ==Description== This command causes the script execution to leave previously called function with callfunc or script with [[cal...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Return&amp;diff=466&amp;oldid=prev"/>
				<updated>2013-06-09T09:39:52Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Syntax== *&amp;#039;&amp;#039;&amp;#039;return&amp;#039;&amp;#039;&amp;#039; [&amp;lt;return value&amp;gt;];  ==Description== This command causes the script execution to leave previously called function with &lt;a href=&quot;/wiki/Callfunc&quot; title=&quot;Callfunc&quot;&gt;callfunc&lt;/a&gt; or script with [[cal...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Syntax==&lt;br /&gt;
*'''return''' [&amp;lt;return value&amp;gt;];&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This command causes the script execution to leave previously called function with [[callfunc]] or script with [[callsub]] and return to the location, where the call originated from. Optionally a return value can be supplied, when the call was done using the function form.&lt;br /&gt;
&lt;br /&gt;
Using this command outside of functions or scripts referenced by callsub will result in error and termination of the script.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
     [[set]] .@var,[[callsub]](L_myAddition,.@a_val,.@b_val);&lt;br /&gt;
     [[mes]] &amp;quot;The result is &amp;quot;+.@var+&amp;quot;.&amp;quot;;&lt;br /&gt;
     [[close]];&lt;br /&gt;
 L_myAddition:&lt;br /&gt;
     return [[getarg]](0)+getarg(1);&lt;br /&gt;
&lt;br /&gt;
     set .@var,[[callfunc]](&amp;quot;MyAddition&amp;quot;,.@a_val,.@b_val);&lt;br /&gt;
     mes &amp;quot;The result is &amp;quot;+.@var+&amp;quot;.&amp;quot;;&lt;br /&gt;
     close;&lt;br /&gt;
     ...&lt;br /&gt;
 &lt;br /&gt;
 function	script	MyAddition	{&lt;br /&gt;
     return getarg(0)+getarg(1);&lt;br /&gt;
 }&lt;br /&gt;
Assuming .@a_val and .@b_val being 1, both examples would yield a message displaying, that the result is 2.&lt;br /&gt;
&lt;br /&gt;
     mes &amp;quot;Oh no...&amp;quot;;&lt;br /&gt;
     [[close2]];&lt;br /&gt;
     callsub L_scream;&lt;br /&gt;
     [[end]];&lt;br /&gt;
 L_scream:&lt;br /&gt;
     [[npctalk]] &amp;quot;Iiiiiiiiiiiiieeeeeeeeeeeeeeeeeeeeeeeeek!!!&amp;quot;;&lt;br /&gt;
     return;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Command]]&lt;/div&gt;</summary>
		<author><name>Via</name></author>	</entry>

	</feed>