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

	<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>2012-04-22T19:21:38-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-04-22T19:21:38-04:00</updated>

		<published>2012-04-22T19:21:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99239#p99239</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99239#p99239"/>
		<title type="html"><![CDATA[New &quot;can't read variable&quot; error in Bogustrivia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99239#p99239"><![CDATA[
BogusTrivia .add and .addk commands require all new trivia files to have 3 questions or more.  The file you tried to add had only 2.<br><br>Next time add only files with 3 or more questions each.<br><br>Goodluck, SpiKe^^<br>mytclscripts.com<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Apr 22, 2012 7:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2012-01-06T15:01:31-04:00</updated>

		<published>2012-01-06T15:01:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98471#p98471</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98471#p98471"/>
		<title type="html"><![CDATA[Re: New &quot;can't read variable&quot; error in Bogustrivia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98471#p98471"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>Tcl error [TAdd]: can't read "wrotetoerr": no such variable</code></pre></div></div></blockquote>The script isn't initializing that variable for all instances. Rather than set a 0 at top and when an error occurs, set a 1. It is setting the 0's and 1's itself manually. So to avoid that error, you can init that error variable before it enters it's while loop to iterate the file contents.<br><br>Noticing though, this script does a very poor job of initializing variables it uses. These "no such variable" errors are rife in this script because of this. It tries to figure out success and fail conditions and sets the variable accordingly. A normal script would initialize the variable as success. Now all the script has to do is detect fail. The var is pre-initialized for success. This is the reason for everyone's issues with "no such variable" errors. The way the logic is written, does not cover every possible outcome, and there are times when it will fail trying to read an uninitialized variable. It's too bad... <br><br>But.. You can force it to initialize the variables as you come across them, and fix this glaring problem.. For your first one..<br><br>Find the line below...<div class="codebox"><p>Code: </p><pre><code>while {![eof $qesfil]} {  set qline [gets $qesfil]</code></pre></div>Above it add...<div class="codebox"><p>Code: </p><pre><code>set wrotetoerr 0</code></pre></div>This should solve your issue. I'm guessing you didn't use a newline before you cause the EOF for the very last line of the file (ie, you didn't press ENTER after every line, even the last one). The code appears to expect a blank line at the end of the file containing the EOF marker by itself.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Jan 06, 2012 3:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Exedore]]></name></author>
		<updated>2012-01-05T21:55:50-04:00</updated>

		<published>2012-01-05T21:55:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98470#p98470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98470#p98470"/>
		<title type="html"><![CDATA[New &quot;can't read variable&quot; error in Bogustrivia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98470#p98470"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>Tcl error [TAdd]: can't read "wrotetoerr": no such variable</code></pre></div>This is after adding a question file with 2 lines to test the script.<br><div class="codebox"><p>Code: </p><pre><code>question1*answerquestion2*answer</code></pre></div>No special characters in questions/answers.<br><br>....aaand show must go on.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9666">Exedore</a> — Thu Jan 05, 2012 9:55 pm</p><hr />
]]></content>
	</entry>
	</feed>
