Thank you both very much for the explanations. So if I got it right, the loop in itself was behaving as expected, but what was being printed in the console was not reflecting that. Instead print behaved like a list prepend. That's good to know, I candidly thought that print objects were printing out stuff in real time irrespective of what was going on in the rest of the patch.
Cheers,
Pierre.
2015-06-03 19:47 GMT+02:00 Jan Baumgart raga.raga@gmx.de:
You need to trigger the print before the recursion branch.
Because you have the print _after_ the recursion branch, the prints can only get triggered after the complete recursion has stopped.
That's why the output is reversed in order.
Take a look at pd manual: 2.3.2. depth first message passing
Cheers, jan
On 06/02/2015 11:10 PM, Pierre Massat wrote:
Dear list,
I just ran into something very odd while trying to parse a string to extract a filename from a path with [list fromsymbol]. Please look at the patch attached. I try to loop backward through the fields of a line in a [text] object to find the first "/" (code 47).
When I do it "manually" (load the list and get the last field, then decrease the counter with a bang until I reach the last "/", everything works fine, and the counter starts at 17 and goes down.
But when I try to automate it by checking if the output equals 47 and by sending a bang to my counter when it's not, I get a very strange result. The counter actually starts at the last occurrence of "/" (47) in field 8, and then goes up to 17.
I am probably very tired and I must be missing something obvious. But right now this looks like aliens have hacked into Pd and are playing with my nerves.
Thanks in advance for your help, Pierre.
PS : I've been using the new text and array objects and I think they're very useful, though not always super intuitive.
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Jan Baumgart Technischer Mitarbeiter Hochschule für Musik und Darstellende Kunst Eschersheimer Landstr. 29-39 60322 Frankfurt am Main