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

	<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-04-04T18:37:57-04:00</updated>

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

		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-04-04T18:37:57-04:00</updated>

		<published>2009-04-04T18:37:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88291#p88291</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88291#p88291"/>
		<title type="html"><![CDATA[How to copy one array to another]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88291#p88291"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>foreach {name value} [array get array1] {set array2($name) $value}</code></pre></div>If you call this on numerous occasions, it would be wise first to unset array2 if it exists, otherwise it could continue to contain elements long since defunct in array1.<br><div class="codebox"><p>Code: </p><pre><code>proc pCopyArray {} {  global array1 array2  if {[array exists array2]} {array unset array2}  foreach {name value} [array get array1] {set array2($name) $value}  return 0}</code></pre></div>Alternatively, and simpler I suppose<br><div class="codebox"><p>Code: </p><pre><code>array set array2 [array get array1]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sat Apr 04, 2009 6:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2009-04-04T15:04:06-04:00</updated>

		<published>2009-04-04T15:04:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88288#p88288</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88288#p88288"/>
		<title type="html"><![CDATA[How to copy one array to another]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88288#p88288"><![CDATA[
Hello,<br><br>Very much a beginner with TCL here. <br>Sorry if this is a dumb question.    I've fumbled around some, and not found it.    If you want to direct me with a link, to some reading, that would be great.  <br><br>I want to set a second array equal to the first array.   <br><br>The first array has, in my rough draft, 10 elements.   They can change, due to activity in the channel, and various binds.<br>I've got that ok,  I think.<br><br>But I think the thing to do, is take a snapshot of it,  when a user through another bind calls a certain procedure.   This way,  the info at that moment is  preserved, and I can manipulate it as need be,  while the first array is still doing its thing... being changed by activity in the channel.<br><br>I thought I'd be able to     set array2 array1<br>or something like that, and array2 would be created with all its elements, just the same as array1 was, at that point in time.<br><br>I haven't found the way to do it yet,   or I've typo'd it every time.<br><br>Any help or direction will be appreciated.<br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sat Apr 04, 2009 3:04 pm</p><hr />
]]></content>
	</entry>
	</feed>
