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

	<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>2003-11-28T11:48:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2003-11-28T11:48:22-04:00</updated>

		<published>2003-11-28T11:48:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30816#p30816</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30816#p30816"/>
		<title type="html"><![CDATA[$nopath and $nofile from mirc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30816#p30816"><![CDATA[
user where have you been all these days? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>Thx a lot, even if I have already written 5 lines of code (fortunately only 5 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">)<br>The "file dirname" and "file tail" works great <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Fri Nov 28, 2003 11:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-27T13:19:23-04:00</updated>

		<published>2003-11-27T13:19:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30778#p30778</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30778#p30778"/>
		<title type="html"><![CDATA[Reinventing the wheel...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30778#p30778"><![CDATA[
Check out <a href="http://tcl.tk/man/tcl8.4/TclCmd/file.htm#M13" class="postlink">file dirname</a> and <a href="http://tcl.tk/man/tcl8.4/TclCmd/file.htm#M38" class="postlink">file tail</a> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Nov 27, 2003 1:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2003-11-27T01:37:54-04:00</updated>

		<published>2003-11-27T01:37:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30757#p30757</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30757#p30757"/>
		<title type="html"><![CDATA[$nopath and $nofile from mirc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30757#p30757"><![CDATA[
thx a lot for your help. It works great <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Thu Nov 27, 2003 1:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[z_one]]></name></author>
		<updated>2003-11-26T16:21:43-04:00</updated>

		<published>2003-11-26T16:21:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30738#p30738</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30738#p30738"/>
		<title type="html"><![CDATA[$nopath and $nofile from mirc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30738#p30738"><![CDATA[
You should be able to do that by using the following string functions:<br>-----------------------------------------------------------<br><strong class="text-strong">string length &lt;string&gt;</strong><br>Returns a decimal string giving the number of characters in string. <br><br><strong class="text-strong">string index &lt;string&gt; &lt;charIndex&gt; </strong><br>Returns the charIndex'th character of the string argument. A charIndex of 0 corresponds to the first character of the string. If charIndex is less than 0 or greater than or equal to the length of the string then an empty string is returned. <br><br><strong class="text-strong">string range &lt;string&gt; &lt;first&gt; &lt;last&gt;</strong><br>Returns a range of consecutive characters from string, starting with the character whose index is first and ending with the character whose index is last. An index of 0 refers to the first character of the string. An index of end (or any abbreviation of it) refers to the last character of the string. If first is less than zero then it is treated as if it were zero, and if last is greater than or equal to the length of the string then it is treated as if it were end. If first is greater than last then an empty string is returned. <br>---------------------------------------------------------<br><br>Here's what you could do for $nofile for example:<br><blockquote class="uncited"><div>- Start by checking the last character of the string (hint: to go to the last character of the string you can use <strong class="text-strong">string index &lt;string&gt; &lt;string length - 1&gt;</strong>)<br><br>- If it's a "/" then stop and return all the string as it is (since it ends with a "/" and it doesn't contain a file name anyway. Assuming it contains more than 1 character of course).<br><br>- Else while (current character is not  "/" and current_position &gt; 0) move 1 character backwards (hint: use a while loop and decrement a <strong class="text-strong">current_position</strong> -&gt; use <strong class="text-strong">string index &lt;string&gt; &lt;current_position&gt;</strong> to check if the character you are positioned at is a "/").<br><br>- Here you have just exited the while.<br>  If &lt;current_position&gt; is &gt; 0 then return the string ranging from 0 to  &lt;current_position&gt; (hint: use <strong class="text-strong">string range &lt;string&gt; 0 &lt;current_position&gt;</strong>)</div></blockquote>Note: if you want $nopath then, at the end of your code, just return the string ranging from &lt;current_position + 1&gt; to &lt;string length -1&gt;<br>(<strong class="text-strong">string range &lt;string&gt; &lt;current_position + 1&gt; &lt;string length - 1&gt;</strong>)<br><br>I hope my example (although not very easily explained) gave you an idea on which logic to use.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=698">z_one</a> — Wed Nov 26, 2003 4:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2003-11-26T13:16:24-04:00</updated>

		<published>2003-11-26T13:16:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30734#p30734</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30734#p30734"/>
		<title type="html"><![CDATA[$nopath and $nofile from mirc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30734#p30734"><![CDATA[
Hello,<br><br>I would like to write $nopath and $nofile that mirc has in tcl.<br><br>examples in mirc<br><br>$nofile(/dir1/dir2/dir3/file.type) returns /dir1/dir2/dir3/<br>$nopath(/dir1/dir2/dir3/file.type) returns file.type<br><br>Any help for 2 these procedures?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Wed Nov 26, 2003 1:16 pm</p><hr />
]]></content>
	</entry>
	</feed>
