[PD] list character count

Frank Barknecht fbar at footils.org
Tue Oct 18 17:31:39 CEST 2005


Hallo,
Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote:

> On Tue, 18 Oct 2005, timon wrote:
> 
> > Im looking for an object - if it exists - that can tell me the number of
> > characters in a message. I need to set a limit to the number to as Im
> > using it for type in GEM. I want to stop the text when the line gets too
> > long.
> > Any clues?
> 
>  |
> [any2symbol]
>  |
> [#import per_message]
>  |
> [#dim]
>  |
> [#export]
>  |
> 
> but then that requires two more libraries (zexy+gf)... i can't think of
> anything simpler for now.

Attached version only requires zexy's s2l (and [list] of pd-0.39), but
it only deals with one symbol. To get the length of more, just
serialize the whole list as done in [pd drip] later.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 354 329 550 541 10;
#X obj 143 137 s2l;
#X msg 173 114 symbol;
#N canvas 0 0 450 300 drip 0;
#X obj 75 213 list split 1;
#X obj 75 133 until;
#X obj 75 168 list append;
#X obj 205 213 bang;
#X obj 75 101 t b l;
#X obj 75 67 inlet;
#X obj 75 255 outlet;
#X text 234 104 see list-help.pd;
#X obj 158 255 outlet;
#X connect 0 0 6 0;
#X connect 0 1 2 1;
#X connect 0 2 3 0;
#X connect 0 2 8 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 1 1;
#X connect 4 0 1 0;
#X connect 4 1 2 1;
#X connect 5 0 4 0;
#X restore 143 181 pd drip;
#X floatatom 187 370 5 0 0 0 - - -;
#X obj 187 350 f;
#X symbolatom 143 42 10 0 0 0 - - -;
#X obj 143 64 t a b;
#X obj 143 204 b;
#X obj 179 289 + 1;
#X msg 228 113 1;
#X obj 143 290 f 1;
#X connect 0 0 2 0;
#X connect 1 0 0 1;
#X connect 2 0 7 0;
#X connect 2 1 4 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 0 0;
#X connect 6 1 1 0;
#X connect 6 1 9 0;
#X connect 7 0 10 0;
#X connect 8 0 10 1;
#X connect 9 0 10 1;
#X connect 10 0 4 1;
#X connect 10 0 8 0;


More information about the Pd-list mailing list