[PD] Handling numbers read from a file

PSPunch shima at pspunch.com
Wed Mar 3 17:31:58 CET 2010


Thanks all,


I have summed up the ideas and created an abstraction containing 
[textfile] with an extra counter to keep track of the pointer.
When requested to step back, it first gates the output, rewinds, then 
bangs [textfile] until it reaches the one previous position.

This is probably least efficient among the mentioned solutions, but is 
compact in size while maintaining compatibility with other messages 
understood by [textfile].

I will post it here if I the performance reasonable in my project.


-- 
David Shimamoto



(2010/03/03 22:01), Jack wrote:
> If you have a list like [34 46 23 ...( and a [table mytab].
> Then [list length] ->  [resize $1( ->  [s mytab] should help.
> Then you send a message [0 34 56 23 ...( ->  [s mytab].
> ++
>
> Jack
>
>
> Le mercredi 03 mars 2010 à 09:23 +0100, Matteo Sisti Sette a écrit :
>> Hans Roels escribió:
>>> There's a simple solution to know the size of an array in Pd vanilla (it
>>> has been posted on this list before). If your array is called example,
>>> send a bang to
>>> [expr size("example")]
>>>
>>
>> That's great!!
>> I didn't know that, and I so often needed it!
>> Thanks a lot.
>>
>> However in this case, when you read the numbers from a file, you must
>> count them _prior_ to storing them into the array.
>> Or is there a way to send a list of numbers to an array and have it
>> automatically resize to the list length?
>>
>>
>>
>
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->  http://lists.puredata.info/listinfo/pd-list





More information about the Pd-list mailing list