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

	<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>2007-07-18T14:01:49-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-07-18T14:01:49-04:00</updated>

		<published>2007-07-18T14:01:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74522#p74522</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74522#p74522"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74522#p74522"><![CDATA[
<blockquote class="uncited"><div>Whats the use of setting an empty array and then unsetting it anyway?</div></blockquote>None to my knowledge..<br>There is, however, a point in unsetting it and then creating an empty array<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jul 18, 2007 2:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-07-18T12:18:39-04:00</updated>

		<published>2007-07-18T12:18:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74517#p74517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74517#p74517"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74517#p74517"><![CDATA[
Whats the use of setting an empty array and then unsetting it anyway?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jul 18, 2007 12:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-07-18T10:58:02-04:00</updated>

		<published>2007-07-18T10:58:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74513#p74513</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74513#p74513"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74513#p74513"><![CDATA[
Maybe I should've been alittle clearer, the code above was intended to initialize the variable upon reset/rehash, and not be used within various procs ("array set" will overwrite any existing data in the array).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jul 18, 2007 10:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anansi]]></name></author>
		<updated>2007-07-18T08:20:56-04:00</updated>

		<published>2007-07-18T08:20:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74511#p74511</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74511#p74511"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74511#p74511"><![CDATA[
Right, but it was bitching about the previously untouched variable "not being an array" when I tried to set one of its members. unsetting the variable just prior to setting it was not an option because the procedure that set the variable was called several times to set different members - unsetting the variable before setting it would mean it would never have more than one member. Fortunately, it was just a problem of eggdrop not reseting the variables well.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9115">Anansi</a> — Wed Jul 18, 2007 8:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-07-18T04:47:30-04:00</updated>

		<published>2007-07-18T04:47:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74510#p74510</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74510#p74510"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74510#p74510"><![CDATA[
You could always create an empty array using this (this requires "myvar" to either be an array or not set at all.):<div class="codebox"><p>Code: </p><pre><code>array set myvar ""</code></pre></div>Or perhaps something like this to make sure the variable is unset prior initialization:<div class="codebox"><p>Code: </p><pre><code>unset myvararray set myvar ""</code></pre></div>Also keep in mind, that the global-command really does'nt create, alter or otherwize directly affect any variable. All it does is link the local variable (within a proc) to the corresponding globalspace variable.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jul 18, 2007 4:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-07-17T20:15:56-04:00</updated>

		<published>2007-07-17T20:15:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74496#p74496</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74496#p74496"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74496#p74496"><![CDATA[
You mean something like this:<br><div class="codebox"><p>Code: </p><pre><code>proc name {arg1 arg2 arg3} { global myarray if {[info exists myarray($arg1)]} {  #whatever you want to do here }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Jul 17, 2007 8:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anansi]]></name></author>
		<updated>2007-07-17T16:54:45-04:00</updated>

		<published>2007-07-17T16:54:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74491#p74491</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74491#p74491"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74491#p74491"><![CDATA[
Can I declare a variable as an array without actually writing anything on it? I want a global array to be initialized within a procedure, but if I don't initialize it outside the procedure when I try to initialize it inside it returns the "not an array" error. I'm using "global arrayname".<br><br>Ok, nevermind. Rehash just didn't reset the variables properly. A restart solved it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9115">Anansi</a> — Tue Jul 17, 2007 4:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anansi]]></name></author>
		<updated>2007-07-17T16:24:05-04:00</updated>

		<published>2007-07-17T16:24:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74490#p74490</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74490#p74490"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74490#p74490"><![CDATA[
array exists was easy to find, but not info exists <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9115">Anansi</a> — Tue Jul 17, 2007 4:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-07-17T15:20:47-04:00</updated>

		<published>2007-07-17T15:20:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74488#p74488</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74488#p74488"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74488#p74488"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>info exists varname - returns 1 if set, or 0 if notinfo exists arrayname(arrayelement) - returns 1 if set, or 0 if not</code></pre></div>To see if an array is set:<br><div class="codebox"><p>Code: </p><pre><code>array exists arrayname - returns 1 if the array is set, or 0 if not</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Tue Jul 17, 2007 3:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anansi]]></name></author>
		<updated>2007-07-17T14:02:09-04:00</updated>

		<published>2007-07-17T14:02:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74486#p74486</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74486#p74486"/>
		<title type="html"><![CDATA[Is set?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74486#p74486"><![CDATA[
Is there a way to return (without crashing the procedure) whether a variable is set or not set? I need this specifically for array elements, but it would also be useful (and work in a similar manner) for normal variables.<br><br>I looked in the Tcl manual and could find nothing.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9115">Anansi</a> — Tue Jul 17, 2007 2:02 pm</p><hr />
]]></content>
	</entry>
	</feed>
