[PD] difference send and using msg with ";"
Matteo Sisti Sette
matteo.sistisette at email.it
Tue Aug 21 12:27:02 CEST 2007
Excerpt from a PD class in 2010 (when $0 for message boxes has been
implemented meaning the same as a $0 in an object box):
STUDENT: So a $ sign in an object means a creation argument of the
abstraction instance. But I've seen some $0's around... I thought $1 was the
first creation argument.
TEACHER: Yes, $1 is the first creation argument. $0 is a sort of special
implicit creation argument which is a number assigned by PD unique to a
patch. It is especially useful as a prefix for assigning "local" names to
sends, receives, values, etc.
STUDENT: Oh, I see. Now, I have tried using $1 and $2 in this message box,
but I get confusing and unexpected results.
TEACHER: (looks at the student's patch) That's because a dollar sign in a
message box is not the same as a dollar sign in an object box. In a message
box, $1 and $2 are the first and second argument of the message that is
input to the message box. They may change every time a message is received.
STUDENT: (showing another patch) Oh. So what does the $0 mean in this
message box?
TEACHER: Well, $0 in a message box *is* the same as in an object box. So you
can access the $0 of the patch from within a message without making a clump
around the message box.
STUDENT: And what if I need to access the $1 or $2 of the patch from within
a message?
TEACHER: You have to make a clump around the message box.
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
La soluzione per vendere o coprare qualcosa, la trovi su Email.it Annunci!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6892&d=21-8
More information about the Pd-list
mailing list