<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/16887" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2009-05-20T13:37:20-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/16887</id>

		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-05-20T13:37:05-04:00</updated>

		<published>2009-05-20T13:37:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88833#p88833</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88833#p88833"/>
		<title type="html"><![CDATA[[SOLVED] return/continue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88833#p88833"><![CDATA[
well thanks<br>im sure im going to figure it out though how to handle it the way i want it to be in combination with ur advices <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Wed May 20, 2009 1:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-05-20T13:06:41-04:00</updated>

		<published>2009-05-20T13:06:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88832#p88832</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88832#p88832"/>
		<title type="html"><![CDATA[[SOLVED] return/continue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88832#p88832"><![CDATA[
Pretty much any goto-logics can be replaced with proper conditional blocks..<br><br>Either by having consecutive conditionals, nested conditionals, or both.<br><br>Ie:<div class="codebox"><p>Code: </p><pre><code>if {case1} { puts stdout "case1 is true" if {case2} {  puts stdout " in addition, case2 is also true" } puts stdout "end of case1 block}</code></pre></div>This would be a perfectly fine replacement for the pseudo-code below:<div class="codebox"><p>Code: </p><pre><code>if {case1} { puts stdout "case1 is true" if {not case2} {  goto end } puts stdout " in addition, case2 is also true" end: puts stdout "end of case1 block"}</code></pre></div>Edit: And no, there is no "goto" function in tcl<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed May 20, 2009 1:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-05-20T11:39:54-04:00</updated>

		<published>2009-05-20T11:39:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88831#p88831</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88831#p88831"/>
		<title type="html"><![CDATA[[SOLVED] return/continue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88831#p88831"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>...if {$chan == "#chan1"} {  if {$nick == "notwantednick"} {    #executed if $chan == #chan1 and $nick == notwantednick  } {    #executed if $chan == #chan1 and $nick != notwantednick  }}if {$::botnick == "nisse"} {  #executed if bot's nick is nisse, regardless of $chan or $nick...}</code></pre></div>Notice how I don't use any return, break, or continue there. Instead I let each code-block run to it's end.</div></blockquote>alright, was thinking of an answer that would tell me to do it otherwise.<br>so theres no way like a goto or similar?<br><br>because sometimes i need the current if or a certain part to end and need another one to continue - as it happens sometimes in pubm's<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Wed May 20, 2009 11:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-05-20T11:14:45-04:00</updated>

		<published>2009-05-20T11:14:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88830#p88830</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88830#p88830"/>
		<title type="html"><![CDATA[[SOLVED] return/continue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88830#p88830"><![CDATA[
Don't use either...<br><br>When using if, the first parameter is the conditional to test, the second the code to execute if the conditional was true. The optional third would be what to execute if the conditional was false. There is no need to "escape" from those code-blocks.. once they reach the end, the processing continues with the first command after the if conditional.<br><div class="codebox"><p>Code: </p><pre><code>...if {$chan == "#chan1"} {  if {$nick == "notwantednick"} {    #executed if $chan == #chan1 and $nick == notwantednick  } {    #executed if $chan == #chan1 and $nick != notwantednick  }}if {$::botnick == "nisse"} {  #executed if bot's nick is nisse, regardless of $chan or $nick...}</code></pre></div>Notice how I don't use any return, break, or continue there. Instead I let each code-block run to it's end.<br><br><strong class="text-strong">Return</strong> has the sole purpose of stopping a proc from running, and returning a value to whatever called the proc in the first place. Whether you use 0 or 1 or anything else won't affect this behaviour, some eggdrop bindings do care for the returned value, but that's outside the scope of this discussion.<br><br><strong class="text-strong">Continue</strong> is used in loops, such as <strong class="text-strong">for</strong>, <strong class="text-strong">foreach</strong>, and <strong class="text-strong">whil</strong>e. It instructs the loop controller to halt the current iteration immediately, and proceed to the next iteration.<br><br><strong class="text-strong">Break</strong> is used in loops, such as <strong class="text-strong">for</strong>, <strong class="text-strong">foreach</strong>, and <strong class="text-strong">while</strong>, as well as the conditional construct <strong class="text-strong">switch</strong> It instructs the controller to halt the current iteration immediately, and return, allowing the next command in the script to be executed.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed May 20, 2009 11:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-05-20T13:37:20-04:00</updated>

		<published>2009-05-20T10:57:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88829#p88829</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88829#p88829"/>
		<title type="html"><![CDATA[[SOLVED] return/continue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88829#p88829"><![CDATA[
i need some help or hint again <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>this time its about return 0/return 1 or something else like that. until now i used to use return 0 if i wanted a script to end but sometimes i only want to escape from the if and continue with the rest of the script. is there a way to do that?<br><br>in example:<br><div class="codebox"><p>Code: </p><pre><code>f { $chan == "#chan1" } {if { $nick == "notwantednick" } {failescape that if and continue with if2, dont stop parsing the rest of the script}}if2 { ... } {code here}</code></pre></div>i hope i got it all right by explaining so you guys know what im after ^^<br><br>edit:<br><br>i might also want to add that i tried playing around with break, return 0, return 1 and continue<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Wed May 20, 2009 10:57 am</p><hr />
]]></content>
	</entry>
	</feed>
