Re: break a variable length list at a specific element

jack <[email protected]>
Newsgroups gmane.comp.multimedia.puredata.general
Message-ID <[email protected]>
Hello,

My two cents.
It's been a while since I posted on this list ;)
++

Jack



Le mercredi 02 octobre 2024 à 14:30 +0200, Ingo Stock a écrit :
> With symbol support.
> 
> 
> Am 02.10.24 um 12:58 schrieb Ingo Stock:
> > A simple approach.
> > 
> > 
> > Am 29.09.24 um 21:08 schrieb Peter P.:
> > > Hi list,
> > > 
> > > I am having lists with a variable number of items and I want to
> > > break 
> > > them
> > > up two lists dependent on the presence of a specific item. I
> > > can't 
> > > seem to
> > > understand how to do it though. Here's a quick example of what I
> > > mean:
> > > 
> > > 1 2 3 4 5 6
> > > look for the number 4 and output two lists (at separate outlets)
> > > which
> > > are before and after that number 4, giving:
> > > 1 2 3
> > > and
> > > 5 6
> > > respectively
> > > 
> > > I'd need the solution to work for lists of other lengths as well,
> > > i.e.
> > > 55 66 77 88 4 102 -33
> > > should be broken up into
> > > 55 66 77 88
> > > and 102 -33
> > > alike.
> > > 
> > > I tried [route] and [list] objects but can't get them to do what
> > > I want.
> > > 
> > > thanks!
> > > P
> > > 
> > > ---
> > > [email protected] - the Pure Data mailinglist
> > > https://lists.iem.at/hyperkitty/list/[email protected]/message/7EF2SASANM67WTX766GIKCN5OIR64PXN/
> > >  
> > > 
> > > 
> > > To unsubscribe send an email to
> > > [email protected] mailing list
> > > UNSUBSCRIBE and account-management -> https://lists.iem.at/
> > > 
> > 
> > ---
> > [email protected] - the Pure Data mailinglist
> > https://lists.iem.at/hyperkitty/list/[email protected]/message/F5B2E6Z5XJPVE3YSBI3ZTZITQRUSPYBX/
> > 
> > To unsubscribe send an email to [email protected] mailing
> > list
> > UNSUBSCRIBE and account-management -> https://lists.iem.at/
> ---
> [email protected] - the Pure Data mailinglist
> https://lists.iem.at/hyperkitty/list/[email protected]/message/VABVF4X5ANT3EBHVRSBDQ52OTPGNMZMQ/
> 
> To unsubscribe send an email to [email protected] mailing
> list
> UNSUBSCRIBE and account-management -> https://lists.iem.at/

---
[email protected] - the Pure Data mailinglist
https://lists.iem.at/hyperkitty/list/[email protected]/message/OWMOYDMJCB5IQSVAKD7FI3FASX5RQMWX/

To unsubscribe send an email to [email protected] mailing list
UNSUBSCRIBE and account-management -> https://lists.iem.at/
list-split-at.pd (text/x-puredata, 1 KB)
#N canvas 735 179 810 404 12;
#X obj 85 73 list-drip;
#X obj 244 275 list store;
#X msg 244 245 append \$1;
#X obj 124 199 spigot 1;
#X obj 124 168 t a a;
#X obj 124 275 list store;
#X msg 124 245 append \$1;
#X obj 244 199 spigot 0;
#X msg 177 173 0;
#X msg 297 174 1;
#X msg 337 174 0;
#X msg 217 173 1;
#X obj 212 104 t b b b;
#X text 187 73 <- from list-abs;
#X obj 124 303 outlet;
#X obj 244 303 outlet;
#X obj 85 37 inlet;
#X obj 185 37 inlet;
#X text 347 326 Jack/RYBN 2024;
#X obj 85 101 sel \$1;
#X connect 0 0 19 0;
#X connect 0 1 12 0;
#X connect 1 0 15 0;
#X connect 2 0 1 0;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 4 1 7 0;
#X connect 5 0 14 0;
#X connect 6 0 5 0;
#X connect 7 0 2 0;
#X connect 8 0 3 1;
#X connect 9 0 7 1;
#X connect 10 0 7 1;
#X connect 11 0 3 1;
#X connect 12 0 1 1;
#X connect 12 0 5 1;
#X connect 12 1 1 0;
#X connect 12 1 5 0;
#X connect 12 2 10 0;
#X connect 12 2 11 0;
#X connect 16 0 0 0;
#X connect 17 0 19 1;
#X connect 19 0 8 0;
#X connect 19 0 9 0;
#X connect 19 1 4 0;
list-split-at-help.pd (text/x-puredata-help, 394 B)
#N canvas 868 638 622 300 12;
#X obj 275 87 list-split-at;
#X msg 275 41 1 2 3 4 5 6;
#X msg 375 41 4;
#X obj 275 132 print A;
#X obj 363 132 print B;
#X msg 65 41 1 2 3 4 5 6;
#X obj 65 132 print A;
#X obj 167 132 print B;
#X obj 65 87 list-split-at 4;
#X connect 0 0 3 0;
#X connect 0 1 4 0;
#X connect 1 0 0 0;
#X connect 2 0 0 1;
#X connect 5 0 8 0;
#X connect 8 0 6 0;
#X connect 8 1 7 0;
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEqdtVRsf0MCe2yTFU66W55yPDwZQFAmb9tEcACgkQ66W55yPD
wZR3pgf/bl/YwzlWzllB6+bIkXIYOzabDqBzKwAtPItb8oi7o4eZwq0lMcvbbe89
wExSJH4sO7/qPaTuLiUHlYitViKA7WoSq7jUTCU22+oCtbW5E9xcRqkbA4MtqoKW
oXLSnyCnO7Admtmd78qx+nae18p8OxdULtzVVBocs2fmwCFUIeZMCRyYZhvZYCDi
mooq0TwdyhusB5Nul4zCmwai4eQ7fr3O7rkZV8PdCDEeSnZaDM2vT+bsDKpufgFn
C8aEL8c3i4jJrz7dR+kekvErooOWoiR2zQd/H7/LyBaer5WQlFMt73IKDMYXGm3B
Tf1EYQ6z6A5hsHiPIrXNdeMfRUCQWA==
=fXhj
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.