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

	<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>2004-06-17T12:03:39-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-06-17T12:03:39-04:00</updated>

		<published>2004-06-17T12:03:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37518#p37518</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37518#p37518"/>
		<title type="html"><![CDATA[need to split a line if too long]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37518#p37518"><![CDATA[
FYI, the wordwrap proc I posted <a href="http://forum.egghelp.org/viewtopic.php?t=6690#33031" class="postlink">here</a> is about 3-10 times faster (depending on the data). (it also tries to keep lines below the max whenever possible without splitting words.)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Jun 17, 2004 12:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jagg]]></name></author>
		<updated>2004-06-17T11:39:44-04:00</updated>

		<published>2004-06-17T11:39:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37517#p37517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37517#p37517"/>
		<title type="html"><![CDATA[need to split a line if too long]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37517#p37517"><![CDATA[
Also from me a BIG THANKS for that code!!!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4460">Jagg</a> — Thu Jun 17, 2004 11:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ShavdApe]]></name></author>
		<updated>2004-05-29T15:47:52-04:00</updated>

		<published>2004-05-29T15:47:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36736#p36736</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36736#p36736"/>
		<title type="html"><![CDATA[need to split a line if too long]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36736#p36736"><![CDATA[
YES YES YES <br>thankyou thankyou thankyou thankyou lol <br><br>been geting on my nerves for so so long<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4266">ShavdApe</a> — Sat May 29, 2004 3:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2004-05-29T15:20:50-04:00</updated>

		<published>2004-05-29T15:20:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36733#p36733</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36733#p36733"/>
		<title type="html"><![CDATA[need to split a line if too long]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36733#p36733"><![CDATA[
i guess i was a bit fast earlier, it wont cut words in two<br><br>here its set to 2<br><blockquote class="uncited"><div>&lt;gb&gt; .t set cs [cutlen "aaa bb cc d" 2]; foreach c $cs { putlog $c }<br>&lt;ufo&gt; aaa<br>&lt;ufo&gt; bb<br>&lt;ufo&gt; cc<br>&lt;ufo&gt; d</div></blockquote>and with 4<blockquote class="uncited"><div>&lt;gb&gt; .t set cs [cutlen "aaa bb cc d" 4]; foreach c $cs { putlog $c }<br>&lt;ufo&gt; [21:31] aaa bb<br>&lt;ufo&gt; [21:31] cc d</div></blockquote>...<br>See if this works<br><blockquote class="uncited"><div>set cutlines [cutlen [split $list] 75]<br>foreach cutline $cutlines {<br>  putserv "PRIVMSG ......"<br>}</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sat May 29, 2004 3:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ShavdApe]]></name></author>
		<updated>2004-05-29T15:23:59-04:00</updated>

		<published>2004-05-29T15:09:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36732#p36732</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36732#p36732"/>
		<title type="html"><![CDATA[need to split a line if too long]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36732#p36732"><![CDATA[
Doesnt seem to work <br><br>I tried reducing the length to 5 and it didnt work<div class="codebox"><p>Code: </p><pre><code>............foreach row [sql "SELECT crapword FROM crapwords"] {incr wordcount 1append wordlist [lindex $row 0] " "    }putquick "PRIVMSG $chan : Total CrapFilter words: $wordcount"putlog " Count $wordcount "set string $wordlist set cutlines [cutlen $string 75] foreach cutline $cutlines {   putserv "PRIVMSG $chan :$cutlines " }}}proc cutlen {str len} { if {$str == ""} {return $str} set strlist "" while {[string length $str] &gt; $len} {  set line ""  foreach word $str {    set line [lappend line $word]    if {[string length $line] &gt;= $len} {      set strlist [lappend strlist $line]      set strpos [expr [string length $line] + 1]      set str [string range $str $strpos end]      break    }  } } set strlist [lappend strlist $str] }</code></pre></div>I tried to reduce the length to 20 and no I still got the same line and not split over multiple lines <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br>Left it at 75 same result and no multiple line<br><br>It does seem to have done something its added { } around the string that matches the length.<br>I would split using } but I have that charachter in the list of words so I would run into a problem there I guess.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4266">ShavdApe</a> — Sat May 29, 2004 3:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2004-05-29T14:51:58-04:00</updated>

		<published>2004-05-29T14:51:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36731#p36731</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36731#p36731"/>
		<title type="html"><![CDATA[need to split a line if too long]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36731#p36731"><![CDATA[
Something like this should work<div class="codebox"><p>Code: </p><pre><code>proc cutlen {str len} {if {$str == ""} {return $str}set strlist ""while {[string length $str] &gt; $len} { set line "" foreach word $str {   set line [lappend line $word]   if {[string length $line] &gt;= $len} {     set strlist [lappend strlist $line]     set strpos [expr [string length $line] + 1]     set str [string range $str $strpos end]     break   } }}set strlist [lappend strlist $str]}</code></pre></div>then just call it with this code <br>and just change 75 to how many chars you want on each line<br><div class="codebox"><p>Code: </p><pre><code>set cutlines [cutlen $var 75]foreach cutline $cutlines {  putserv "PRIVMSG ......"}</code></pre></div>Hope this helps<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sat May 29, 2004 2:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ShavdApe]]></name></author>
		<updated>2004-05-29T14:27:46-04:00</updated>

		<published>2004-05-29T14:27:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36728#p36728</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36728#p36728"/>
		<title type="html"><![CDATA[need to split a line if too long]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36728#p36728"><![CDATA[
I have a bunch of words stored in a mysql database that I want to list but the line is too long<br><div class="codebox"><p>Code: </p><pre><code>foreach row [sql "SELECT crapword FROM crapwords"] {incr wordcount 1append wordlist [lindex $row 0] " "    }putquick "PRIVMSG $chan :Total Crapwords: $wordcount"putquick "PRIVMSG $chan : $wordlist "</code></pre></div>anyway i can split the line once it reaches a certain size?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4266">ShavdApe</a> — Sat May 29, 2004 2:27 pm</p><hr />
]]></content>
	</entry>
	</feed>
