ok Lio, that works.
So the wiki is not totally right :s Can somebody correct this ?

Instead of :
-------------------
To get a copy:

upvar 2 $epvar args
set nick $args(nick)

write :
-----------------
To get a copy:

upvar 2 $epvar args
upvar 2 $args(nick) nick


( tested and tested again ;p )

Included: the patch to revert ... my patch (if needed)


Thanx for help and sorry again for having introduced problems.

On 8/15/06, Arieh Schneier <[EMAIL PROTECTED]> wrote:
I have been really busy, and its been a while since I have had time to do
some coding. I just had a quick look at the mailing list (have stacks of
unread messages), just thought I'd make a quick note about this.

There were 2 ways that we were deciding on doing the variable passing, 1
which allowed feedback (ability to change the source variable ie pass by
reference) and the second which only passed the value (pass by value). I am
not sure if we decided on a global method for all events or if they all
currently use the same method. That even was changed from passing a value to
passing a reference by billiob in change 6435 to 6647
(http://svn.sourceforge.net/viewvc/amsn/trunk/amsn/automsg.tcl?r1=6435&r2=66
47), I am not sure why though. You are then trying to access the value,
however you are getting the reference.

I haven't tested, but this should work (if you revert your patch):
upvar 2 $evpar args
upvar 2 $args(idx) idx
set substate $idx

But then again, that event is posted after the status change when $new_state
is not used any more, so I am not sure why we would need pass by reference
in that case.

Lio.

PS also note the evpar/epvar confusion is still going on.

----- Original Message From: "Yoda-BZH - Tristan Charbonneau" -----
I don't need to modify them, I just want to read them, to determine to
which state I switched.

On 8/12/06, Philippe Valembois - Phil
<[EMAIL PROTECTED]> wrote:
> OOps sorry I mixed some reminds... You are right :d
> The way to use the pointers is :
> upvar 2 new_state new_state
> To be able to modify the new_state variable...
> Again sorry...
> Phil
>
> Le Saturday 12 August 2006 13:03, Yoda-BZH - Tristan Charbonneau a écrit:
> > hmmmmm
> > I followed the wiki :
> >
> > To get a copy:
> >
> > upvar 2 $epvar args
> > set nick $args(nick)
> >
> > So I wrote :
> > upvar 2 $evpar args
> > set substate $args(idx)
> >
> > but when I wrote : status_log "test : $substate"
> > it printed : "test : new_state", and with my patch it print "BSY",
> > "IDL", "AWY" ...
> >
> > So I doesn't really understand if my patch is wrong. What must I do so ?
:s
> >
> > On 8/12/06, Philippe Valembois - Phil
> >
> > <[EMAIL PROTECTED]> wrote:
> > > Noooooooooo
> > > They weren't typos !
> > > It was by design !
> > > Here you chose the easy solution but it removes abilities !
> > > You are putting in the array the values ! It mustn't be like that !
> > > Before the array was filled by a sort of pointers to variables which
let
> > > you to modify the values !
> > > Phil
> > > P.S. I thought you understood how it worked but I realize that you
> > > didn't... Anyway, I have to go so I hope Vivia will be able to revert
the
> > > changes...
> > >
> > > Le Saturday 12 August 2006 11:49, Yoda-BZH - Tristan Charbonneau a
écrit:
> > > > no problem :)
> > > >
> > > > On 8/12/06, Vivia Nikolaidou <[EMAIL PROTECTED]> wrote:
> > > > > On 8/12/06, Yoda-BZH - Tristan Charbonneau <[EMAIL PROTECTED]>
wrote:
> > > > > > There's somes '$' forgotten in automsg.tcl
> > > > > >
> > > > > > Instead of passing $automessage and $new_state to
ChangeMyState's
> > > > > > PostEvent, "automessage" and "new_state"
> > > > > >
> > > > > > Please apply this, thanks :)
> > > > >
> > > > > Applied, thanx for reporting! :)
> > >


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel



--
Admin WestArena : http://www.westarena.net 28 - 29 - 30 avril 2006 à
Landerneau (29)
Admin AAG : http://www.2ag-fr.com

http://www.yoda-bzh.net
http://blog.yoda-bzh.net

o May the Force be with you
o Do it, or not, but there's no try
--- automsg.tcl	2006-08-12 01:50:27.000000000 +0200
+++ automsg.orig.tcl	2006-08-12 01:50:17.000000000 +0200
@@ -310,12 +310,12 @@
 
 	if { [info exists new_state] } {
 		::MSN::changeStatus $new_state
 
 		#PostEvent 'ChangeMyState' when the user changes his/her state
-		set evPar(automessage) $automessage
-		set evPar(idx) $new_state
+		set evPar(automessage) automessage
+		set evPar(idx) new_state
 		::plugins::PostEvent ChangeMyState evPar
 	} else {
 		status_log "ChCustomState where state didnt exist !!!" red
 	}
 
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to