<?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/6127" />

	<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>2003-11-18T12:50:39-04:00</updated>

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

		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2003-11-18T12:50:39-04:00</updated>

		<published>2003-11-18T12:50:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30264#p30264</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30264#p30264"/>
		<title type="html"><![CDATA[$$var and switch question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30264#p30264"><![CDATA[
yeah... seems good work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Tue Nov 18, 2003 12:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-11-17T12:10:09-04:00</updated>

		<published>2003-11-17T12:10:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30187#p30187</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30187#p30187"/>
		<title type="html"><![CDATA[$$var and switch question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30187#p30187"><![CDATA[
I'm shure he didn't <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Nov 17, 2003 12:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2003-11-17T11:28:35-04:00</updated>

		<published>2003-11-17T11:28:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30186#p30186</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30186#p30186"/>
		<title type="html"><![CDATA[$$var and switch question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30186#p30186"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>if {[info exists var($value)]} {</code></pre></div></div></blockquote>wouldnt this check for var? it should check if vonend($value) exists.<blockquote class="uncited"><div>also, call globaly the vonend (add a "global vonend" line in the proc) and there is no need of two $ when calling the variable/array</div></blockquote>sorry, forgot that. of course i have this global line with all possible values for "var". <br><br>@user: yes, this seems more correct to me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> thx and ill come back if you told me nonsense <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Mon Nov 17, 2003 11:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-16T15:35:07-04:00</updated>

		<published>2003-11-16T15:35:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30132#p30132</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30132#p30132"/>
		<title type="html"><![CDATA[$$var and switch question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30132#p30132"><![CDATA[
Your code fails because you're working with the local variable "var" and not the target array. Try this:<div class="codebox"><p>Code: </p><pre><code>proc avote:getValue {array element} {upvar 1 $array varif {[info exists var($element)]} {set var($element)} {set var(standard)}}</code></pre></div><blockquote class="uncited"><div>and then ive got a question about the switch command.<br>ive got: if {x=="1" || x=="2"} {<br>what would that be in a switch command?</div></blockquote><div class="codebox"><p>Code: </p><pre><code>switch -- x {    "1" - "2" {do stuff}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Sun Nov 16, 2003 3:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-11-16T15:38:48-04:00</updated>

		<published>2003-11-16T15:34:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30131#p30131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30131#p30131"/>
		<title type="html"><![CDATA[$$var and switch question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30131#p30131"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {[info exists var($value)]} {</code></pre></div>also, call globaly the vonend (add a "global vonend" line in the proc) and there is no need of two $ when calling the variable/array<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Nov 16, 2003 3:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2003-11-16T14:47:11-04:00</updated>

		<published>2003-11-16T14:47:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30128#p30128</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30128#p30128"/>
		<title type="html"><![CDATA[$$var and switch question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30128#p30128"><![CDATA[
hi<br>got some problem. in my script i have several standard settings which can be overwritten by chan settings.<br>e.g. i have var vonend(standard), vonend(#mychan) and vonend(#anotherchan). now if vonend(#mychan) exists, the script should use vonend(#mychan), otherwise vonend(standard).<br>now to prevent an [info exists] every time i need a variable, i wrote a proc which should decide wheter chan setting or standard setting is taken.<br>here is what i got:<div class="codebox"><p>Code: </p><pre><code>proc avote:getValue {var value} {if {[info exists $var($value)]} {return $$var($value)} else {return $$var(standard)}}</code></pre></div>its called with<div class="codebox"><p>Code: </p><pre><code>avote:getValue "vonend" "#mychan"</code></pre></div>but i always get "Tcl error [avote:getValue]: can't read "var(standard)": variable isn't array". normally it should check if vonend(#mychan) exists and then decide whether to use vonend(#mychan) or vonend(standard)<br>can anyone please correct my code?<br>and then ive got a question about the switch command.<br>ive got: if {x=="1" || x=="2"} {<br>what would that be in a switch command?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Sun Nov 16, 2003 2:47 pm</p><hr />
]]></content>
	</entry>
	</feed>
