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

	<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>2009-04-04T13:32:39-04:00</updated>

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

		<entry>
		<author><name><![CDATA[UK10]]></name></author>
		<updated>2009-04-04T13:32:39-04:00</updated>

		<published>2009-04-04T13:32:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88287#p88287</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88287#p88287"/>
		<title type="html"><![CDATA[mysqlquery: not mysqltcl handle]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88287#p88287"><![CDATA[
thank ; but don't work<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7250">UK10</a> — Sat Apr 04, 2009 1:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-03-30T14:17:22-04:00</updated>

		<published>2009-03-30T14:17:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88212#p88212</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88212#p88212"/>
		<title type="html"><![CDATA[mysqlquery: not mysqltcl handle]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88212#p88212"><![CDATA[
Some examples regarding variable spaces then.<div class="codebox"><p>Code: </p><pre><code>set myvar 1proc test1 {} { putlog $::myvar}proc test2 {} { putlog $myvar}proc test3 {} { global myvar putlog $myvar}proc test4 {} { upvar #0 myvar test putlog $test putlog $myvar}proc test5 {} { upvar #0 myvar test putlog $test putlog $::myvar set myvar 2 putlog $myvar putlog $::myvar}</code></pre></div>The above shows a few working and non-working procs that try to access the globalspace variable <em class="text-italics">::myvar</em> (set in the beginning of the script):<br><ul><li>test1 (works):<br>Here we access the variable using the full namespace path <em class="text-italics">::myvar</em></li><li>test2 (not working):<br>Here we try to access the variable, but we leave out the namespace path. As such, instead we'll end up trying to access the local variable myvar, which does not exist. You'll end up with an error stating "No such variable".</li><li>test3 (works):<br>Here we first use the <strong class="text-strong">global</strong> command, which will link the local variable <em class="text-italics">myvar</em> to the globalspace variable <em class="text-italics">::myvar</em>. As a result, whenever we access <em class="text-italics">myvar</em>, we'll actually end up operating on <em class="text-italics">::myvar</em>.</li><li>test4 (works, but generates an error):<br>Here we first use the <strong class="text-strong">upvar</strong> command to link the local variable <em class="text-italics">test</em> with the globalspace variable <em class="text-italics">::myvar</em>. The first putlog will work, as it accesses the now linked variable <em class="text-italics">test</em>. The second putlog will however fail, as there still is no local <em class="text-italics">myvar</em> variable.</li><li>test5 (works):<br>Here we also link <em class="text-italics">test</em> with <em class="text-italics">::myvar</em>, but it also illustrates how setting a local variable will not affect a globalspace one.</li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Mar 30, 2009 2:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[UK10]]></name></author>
		<updated>2009-03-30T14:00:13-04:00</updated>

		<published>2009-03-30T14:00:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88211#p88211</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88211#p88211"/>
		<title type="html"><![CDATA[mysqlquery: not mysqltcl handle]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88211#p88211"><![CDATA[
give me example  about this code<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7250">UK10</a> — Mon Mar 30, 2009 2:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[UK10]]></name></author>
		<updated>2009-03-28T22:59:50-04:00</updated>

		<published>2009-03-28T22:59:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88184#p88184</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88184#p88184"/>
		<title type="html"><![CDATA[mysqlquery: not mysqltcl handle]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88184#p88184"><![CDATA[
strange , before that running without modifications<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7250">UK10</a> — Sat Mar 28, 2009 10:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-03-28T13:27:33-04:00</updated>

		<published>2009-03-28T13:27:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88155#p88155</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88155#p88155"/>
		<title type="html"><![CDATA[mysqlquery: not mysqltcl handle]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88155#p88155"><![CDATA[
First, the proc that caused the error is not included in the posted code.<br>Secondly, when you connect, you run the code in globalspace, so the database handle is stored in <em class="text-italics">::mysql_handle</em>r, yet atleast in pub:test, you are trying to use the localspace variable <em class="text-italics">mysql_handler</em>. Most likely, you forgot to link the localspace variable to the globalspace one (using the <strong class="text-strong">global</strong> command).<br><br>Same goes for several other variables in your pub:test proc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Mar 28, 2009 1:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[UK10]]></name></author>
		<updated>2009-03-28T09:03:31-04:00</updated>

		<published>2009-03-28T09:03:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88153#p88153</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88153#p88153"/>
		<title type="html"><![CDATA[mysqlquery: not mysqltcl handle]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88153#p88153"><![CDATA[
Hi..need help thx<br><div class="codebox"><p>Code: </p><pre><code>PREDB : Error connexion  MySQL ! Tcl error [pub:addpre]: mysqlquery: not mysqltcl handle</code></pre></div>Tcl scripting<div class="codebox"><p>Code: </p><pre><code>################################ Connexion à MySQL################################load libmysqltcl.dllpackage require mysqltclif { [catch {mysqlstate $mysql_handler}] } { if [catch {mysqlconnect -host $host -user $user -password $password -db $db} mysql_handler] {  putquick "PRIVMSG $chanadd :Error MySQL !!"  putlog "PREDB : Error connexion MySQL !" }} else {  putlog "PREDB: MYSQL connected !"}bind pub - !test pub:testproc pub:test {nick uhost handle channel arg } {global Hdecalage chanadd chanpre botnetkick1 prebotnick erreurif { [catch {mysqlstate $mysql_handler}] } { if [catch {mysqlconnect -host $host -user $user -password $password -db $db} mysql_handler] {  putlog "PREDB : Error MySQL !" }} else {  putlog "PREDB : Connect MySQL !"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7250">UK10</a> — Sat Mar 28, 2009 9:03 am</p><hr />
]]></content>
	</entry>
	</feed>
