Carriage Returns in [sprintf]

Aug 5, 2008 at 9:48pm

Carriage Returns in [sprintf]

Does anyone know what the newline/carriage return escape character for max is? I’ve tried a number of things, none of which seem to work. I’m trying to format a comment box, to display:

Current File:
filename.wav
Current Folder:
thisisafolder/

But I can’t do it if there’s no carriage return character.

#39153
Aug 5, 2008 at 9:53pm

Quote: MuShoo wrote on Tue, 05 August 2008 14:48
—————————————————-
> Does anyone know what the newline/carriage return escape character for max is?

\n

It’s the normal n with the escaped by another .

mz

#137488
Aug 5, 2008 at 10:02pm

Tried that one, it doesn’t seem to work.

– Pasted Max Patch, click to expand. –
#137489
Aug 6, 2008 at 12:05am

On Aug 5, 2008, at 2:48 PM, mushoo wrote:

> Does anyone know what the newline/carriage return escape character
> for max is?

As far as I know there’s no way to do this. Using multiple comment
fields is how I usually approach this sort of thing.

-C

Chris Muir
cbm@well.com

http://www.xfade.com

#137490
Aug 6, 2008 at 12:29am

Yeah, that’s what I’m currently doing – the problem is that if someone happens to have a folder or filename that’s atrociously long, it bleeds over into areas I don’t want it to.

#137491
Aug 6, 2008 at 12:50am

Could you not send the text to the [textedit] object instead of a comment as you can set sizes for those?

lh

#137492
Aug 6, 2008 at 12:57am

It seems like yes, I could, but I’m not sure I like that more or less than having text bleed around. With the textedit object, anything that goes past it’s boundaries is just invisible, which could be bad. Say someone has two folders, “Folder A” and ‘Folder B’ but the last character has gotten cut off by the textedit window. That last character is the most important one for knowing where your files are going to end up.

#137493
Aug 6, 2008 at 1:09am

Have a look at the [textedit] inspector, try turning the automatic scrolling on and the readonly off. This allows you to click in the box and use the arrow keys to scroll vertically, if you size it right you can fit the text line by line. This means you can get to the important end bit, it just might not be on screen straight away which is possibly what you’re after. Another downside is that the user can accidentally type stuff in the box.

lh

#137494
Aug 6, 2008 at 3:53am

On Aug 5, 2008, at 2:54 PM, mzed wrote:

> It’s the normal
> with the escaped by another .

Really? I’ve never been able to get this to work.

Do you have a patch that will load a multi-line comment like the
original poster asked?

-C

Chris Muir
cbm@well.com

http://www.xfade.com

#137495
Aug 6, 2008 at 10:03am

Use cr, and connect it to a [textedit] object. The text written into the text edit object will be formatted correctly.

#137496
Sep 15, 2012 at 9:55am

For example in the stefan typewriter patch, when should I insert the [sprintf cr] object ?

#137497

You must be logged in to reply to this topic.