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

	<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>2004-03-03T12:13:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-03-03T12:13:17-04:00</updated>

		<published>2004-03-03T12:13:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34202#p34202</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34202#p34202"/>
		<title type="html"><![CDATA[${type}game($number) - reading]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34202#p34202"><![CDATA[
It's only with subst and eval. And to use $z you probably have to do \$z, but I can't check right now.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Mar 03, 2004 12:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-03T10:35:15-04:00</updated>

		<published>2004-03-03T10:35:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34196#p34196</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34196#p34196"/>
		<title type="html"><![CDATA[${type}game($number) - reading]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34196#p34196"><![CDATA[
I'm afraid i'm allready in it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_evil.gif" width="15" height="15" alt=":evil:" title="Evil or Very Mad"> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"> <br><br>That what you are tying to do with $${x}y($z) gives errors with me, or is this what you do only valid with the subst command?<p>Statistics: Posted by Guest — Wed Mar 03, 2004 10:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-03-03T10:04:48-04:00</updated>

		<published>2004-03-03T10:04:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34195#p34195</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34195#p34195"/>
		<title type="html"><![CDATA[${type}game($number) - reading]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34195#p34195"><![CDATA[
Another way to do it is with upvar, especially if it's a global variable. You create a link to the array and then manipulate it as if it were the other variable.<br><br>proc doit {} {<br>  set type green<br>  set var hunger<br>  upvar #0 ${type}dragon link<br>  set link($var) "sheep"<br>}<br><br>now global greendragon(hunger) = sheep<br><br>The same thing works for local variables, using 0 instead of #0 in upvar.<br><br>You can also do tricks like the set one with subst and eval:<br><br>set type green<br>set a [subst $${type}dragon(hunger)]<br>eval set b $${type}dragon(hunger)<br><br>now $a = $b = sheep<br><br>You are entering the dark side of tcl scripting. Don't let its power draw you in!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Mar 03, 2004 10:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-03T09:46:35-04:00</updated>

		<published>2004-03-03T09:46:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34192#p34192</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34192#p34192"/>
		<title type="html"><![CDATA[${type}game($number) - reading]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34192#p34192"><![CDATA[
woohoo! now it works <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"> <br><br>Could you give me the alternative means to do this aswell?<br><br>thanks for the help, been bashing my head on this for a few days now, trying to work around it with no luck <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"><p>Statistics: Posted by Guest — Wed Mar 03, 2004 9:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-03-03T09:21:50-04:00</updated>

		<published>2004-03-03T09:21:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34190#p34190</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34190#p34190"/>
		<title type="html"><![CDATA[${type}game($number) - reading]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34190#p34190"><![CDATA[
A couple ways to do it. Maybe the easiest way is to use the set command. It returns the value of the variable you give it, so you can do more advanced substitution using it:<br><br>set num [set ${type}game($number)]<br><br>Now $num = $jasdfgame($number)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Mar 03, 2004 9:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-03T08:44:48-04:00</updated>

		<published>2004-03-03T08:44:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34187#p34187</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34187#p34187"/>
		<title type="html"><![CDATA[${type}game($number) - reading]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34187#p34187"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set i 0 lappend game "" set id [array startsearch alias] while {[array anymore alias $id]} {        set item [array nextelement alias $id]        set ding [split $item #]        set type [lindex $ding 0]        set number [lindex $ding 1]        set ${type}game($number) "$alias($item)" if {$type == "jkja"} { putchan $chan "debug1: ${type}game($number)" }        lappend num $i        lappend output $type        if {[lsearch -all $game $type] &gt;= 1} {                continue        } else {                lappend game $type        }        incr i }</code></pre></div>The problem is that in the 'if {$type == "jkja"}' line the output of the putchan is jkjagame(1) rather then what that value holds, if i change ${type}game($number) into $jkjagame($number) it works and displays just that what the array value holds...<br><br>What am i doing wrong here?<p>Statistics: Posted by Guest — Wed Mar 03, 2004 8:44 am</p><hr />
]]></content>
	</entry>
	</feed>
