Communauté Eggdrop
Probleme namespace, variable, proc - Version imprimable

+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Scripts TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=4)
+--- Sujet : Probleme namespace, variable, proc (/showthread.php?tid=1380)



Probleme namespace, variable, proc - ZarTek - 01/08/2013

Voici le code
Code :
namespace eval ::[set ::BSNS]::SQL {

    variable nsc    [namespace current];
    variable nsp    "::[set ::BSNS]";
    
    proc [set nsc]:OPEN { args } {
        variable nsc;
        variable nsp;
        
        putlog [set ${nsp}::MySQL(Host)]
    }
}

::[set ::BSNS] contient le nom du namespace primaire

J'ai une erreur can't read "nsp": no such variable

J'ai mis en piece jointe tout le code


RE: Probleme namespace, variable, proc - CrazyCat - 01/08/2013

J'avoue ne pas bien comprendre où tu veux en venir avec un code pareil.
Et dans ta procédure, tu redéclares $nsp à rien, elle est juste initialisée


RE: Probleme namespace, variable, proc - cestlemien - 03/08/2013

salut

(un rapport avec le site ? plutot eggdrop non ? )


cordialement.


RE: Probleme namespace, variable, proc - CrazyCat - 03/08/2013

Pas faux Smile