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

	<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>2002-06-05T21:09:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-06-05T21:09:00-04:00</updated>

		<published>2002-06-05T21:09:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=7724#p7724</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=7724#p7724"/>
		<title type="html"><![CDATA[This for some reason wont work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=7724#p7724"><![CDATA[
Beside the counting offset of one line, the code "while {![eof $fp]}" doesn't produce any errors afaik. But it should be clear that one extra empty line is processed by the code following the [gets]. This may be undesired behaviour.<br><br>One can argue that the "while {![eof $fp]}" at least makes explicit what the intention of the code is.<br>To make the intention explicit one could also throw in a "# read until EOF" line.<br><br>But why use EOF anyway? ...some additional info <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"><br><br><a href="http://mini.net/tcl/367.html" class="postlink">http://mini.net/tcl/367.html</a><br><br>and<br><br><a href="http://starbase.neosoft.com/~claird/comp.lang.tcl/fmm.html#eof" class="postlink">http://starbase.neosoft.com/~claird/com ... m.html#eof</a><br><br>&lt;font size=-1&gt;[ This Message was edited by: egghead on 2002-06-05 19:22 ]&lt;/font&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Wed Jun 05, 2002 9:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Petersen]]></name></author>
		<updated>2002-06-05T20:32:00-04:00</updated>

		<published>2002-06-05T20:32:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=7723#p7723</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=7723#p7723"/>
		<title type="html"><![CDATA[This for some reason wont work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=7723#p7723"><![CDATA[
yes. this is true for just about every language. eof is a function of a read statement - it gets set as a result of a failed read due to falling off the end of the file. opening a file never checks whats in it, or how long it is. It just opens the file descriptor and points to the first byte of the file (if it exists or not). It only discovers if it exists once you try to read it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=60">Petersen</a> — Wed Jun 05, 2002 8:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-06-05T16:06:00-04:00</updated>

		<published>2002-06-05T16:06:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=7702#p7702</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=7702#p7702"/>
		<title type="html"><![CDATA[This for some reason wont work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=7702#p7702"><![CDATA[
PPSlim - No, even if you open an empty file, you will not get eof until you attempt a read. Try it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Jun 05, 2002 4:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-06-05T11:34:00-04:00</updated>

		<published>2002-06-05T11:34:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=7693#p7693</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=7693#p7693"/>
		<title type="html"><![CDATA[This for some reason wont work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=7693#p7693"><![CDATA[
No - he has done right by checking for EOF before the gets.<br><br>Remember this is a while loop.<br><br>While checking for EOF after the gets does the same thing, it will cause a empty file to have a EOF read, before it is detected.<br><br>You should check for an EOF before a read, to prevent a failed read.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Jun 05, 2002 11:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-06-05T03:19:00-04:00</updated>

		<published>2002-06-05T03:19:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=7677#p7677</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=7677#p7677"/>
		<title type="html"><![CDATA[This for some reason wont work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=7677#p7677"><![CDATA[
Erm, this code worked for me...<br><br>Maybe you're using different case (capital/lowercase) in the nicks? You're probably better off using "string compare -nocase" than "==".<br><br>Also, just a little nitpick, you should check for eof after gets, not before.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Jun 05, 2002 3:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[[Nero]]]></name></author>
		<updated>2002-06-04T14:15:00-04:00</updated>

		<published>2002-06-04T14:15:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=7655#p7655</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=7655#p7655"/>
		<title type="html"><![CDATA[This for some reason wont work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=7655#p7655"><![CDATA[
This will not find the nick in the templist<br><br><br>set file templist<br>set found 0 <br>set fs [open $file r] <br>while {![eof $fs]} { <br>  gets $fs line <br>  if {$line == $nick} { set found 1 } <br>} <br>close $fs <br>if {$found} { <br>  puthelp "PRIVMSG $chan : was found!" <br>} else { <br>  puthelp "PRIVMSG $chan : was not found." <br>} <br><br>&lt;font size=-1&gt;[ This Message was edited by: [Nero] on 2002-06-04 12:16 ]&lt;/font&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1317">[Nero]</a> — Tue Jun 04, 2002 2:15 pm</p><hr />
]]></content>
	</entry>
	</feed>
