Yes, you can certainly turn a list into a single symbol, either with [list fromsymbol] + [list tosymbol], or using externals like zexy's [s2l].

But the actual problem is how you get plain text input in Pd. [text] is certainly *not* suitable for that.

Once you have your own Tcl editor widget, you can easily send the text in any form you want (a single symbol, a list of atoms, a list of bytes, ...)

Christof

On 27.10.2020 15:46, Iain Duncan wrote:
Thanks Christof.

What about tosymbol, is there a Pd equivalent for taking a multi-atom message and turning it into a single string? or other good way of doing that?



On Tue, Oct 27, 2020 at 7:40 AM Christof Ressi <i...@christofressi.com <mailto:i...@christofressi.com>> wrote:

    Pd has the [text] object for entering text, but I think it is not
    really suitable for your use case, because it is meant for typing
    Pd lists and therefore treats several characters specially (e.g.
    semicolons, colons).

    If you want interactive editing, I think you need to make your own
    Tcl GUI object with a plain text editor. If you're a brave Tcl
    programmer, you could even add syntax highlighting and auto
    identation ;-)

    For inspiration, you could have a look at the [entry] object of
    the old "flatgui" library, which is basically a widget for plain text.

    Christof

    On 27.10.2020 15:18, Iain Duncan wrote:
    Hi folks, I'm in the design stages of porting my Scheme for Max
    external to Pd, and have some questions already. :-)

    What is the best way to deal with large-ish blocks of text in Pd
    for sending big text messages to an object? In Max (in case
    readers know it) I use a textedit object to allow the user to
    enter several lines of code, this goes to a tosymbol to turn into
    one giant symbol, and then I use a prepend to get a single
    message that looks like the below

    eval-string "(define (hello-world) (post :hello-world))"

    The above then comes into my external as two atoms.

    If anyone has suggestions for the best way to do that, or knows
    of externals I might want to use to accomplish the above, that
    would be lovely.

    iain

    _______________________________________________
    Pd-list@lists.iem.at  <mailto:Pd-list@lists.iem.at>  mailing list
    UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list 
 <https://lists.puredata.info/listinfo/pd-list>
    _______________________________________________
    Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list
    UNSUBSCRIBE and account-management ->
    https://lists.puredata.info/listinfo/pd-list
    <https://lists.puredata.info/listinfo/pd-list>

_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to