[PD-dev] allow only one instance of external object

Frank Barknecht fbar at footils.org
Sun Mar 23 11:53:01 CET 2008


Hallo,
best boy hat gesagt: // best boy wrote:

> is there a way to keep track of the number of opened instances of an external?
> if so, can anyone point me to an example object?

You could wrap it inside an abstraction which has a running counter
stored in a [value MYOBJECTCOUNT] object. "MYOBJECTCOUNT" should be
unique. The counter then gets incremented with each new instance of
your abstraction. You cannot delete objects though without the counter
getting out of sync unless you use a Pd with [closebang] or so.

For various obvious reasons, this is not a very good general
solution, though.

Ciao
-- 
 Frank Barknecht                                     _ ______footils.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objcounter.pd
Type: application/puredata
Size: 331 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20080323/a3440bf4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objcounter-help.pd
Type: application/puredata
Size: 474 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20080323/a3440bf4/attachment-0001.bin>


More information about the Pd-dev mailing list