[PD] pdstring feature requests...
IOhannes m zmoelnig
zmoelnig at iem.at
Wed Jul 25 15:29:28 CEST 2007
during my recent work with pdstrings, 2 issues came upon me.
[any2string]: this object usually terminates the output string with a 0
(after all it is a somewhat arkward representation of a c-string).
it would be cool if one could change this, and make it configurable.
currently i have to [list split] the string list before the last element
(using [list length]) and then [list append] CRLF. this seems a bit of
an overhead to me.
[string2any]: analogous to the above described behaviour, [string2any]
will stop processing whenever it encounters a "0" string element.
for instance "97 32 98 0 99" will result in a 2-element list "a b".
this prevents the user from simply concatenating to strings generated
with [any2string] (since the result of the latter will include a
terminating 0 which will make the former stop when processing the
what i would like to have is:
[any2string]: make the string end configurable;
e.g. [any2string 0] will create \0 terminated strings;
[any2string 13 10] will terminate the string with CRLF;
for compatibility reasons i would let [anystring] (without args) output
the 0-terminated list (even though if i had the chance i would prefer to
it to not use any terminating elemets at all per default); one could
imagine a 2nd inlet to set the terminator (sending an empty list would
mean "no termination")
[string2any]: what i would really like, is having [string2any] output
multiple messages if it encounters a "delimiter" (instead of a
"terminator"), e.g. "0"; this would make "97 32 98 0 99" output "a b"
[string2any]: analogous to the [any2string] request i would love to be
able to change the delimiter (again: via arguments and/or 2nd inlet);
for instance i am dealing with strings delimited by CRLF (get them from
[tcpserver]), and parsing that into several messages (line-by-line) is a
task i would like to be done within [string2any].
109 097 114 109 111 115 101 116 115
More information about the Pd-list