Forums > MaxMSP

Carriage Returns in [sprintf]

Aug 05 2008 | 9:48 pm

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:
Current Folder:

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

Aug 05 2008 | 9:53 pm

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


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


Aug 05 2008 | 10:02 pm

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

— Pasted Max Patch, click to expand. —
Aug 06 2008 | 12:05 am

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.


Chris Muir

Aug 06 2008 | 12:29 am

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.

Aug 06 2008 | 12:50 am

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


Aug 06 2008 | 12:57 am

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.

Aug 06 2008 | 1:09 am

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.


Aug 06 2008 | 3:53 am

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?


Chris Muir

Aug 06 2008 | 10:03 am

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

Sep 15 2012 | 9:55 am

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

Viewing 11 posts - 1 through 11 (of 11 total)

Forums > MaxMSP