Forums > MaxMSP

Can pattr be used to store string?

April 2, 2009 | 9:25 pm

I am writing a patch where I need to store a series of filenames and other parameters from run to run.

autopattr and pattrstorage seem to work fine for numbers – however, the messageboxes where I am keeping filenames just show "object(message)" as the content, in the pattstorage clientwindow and storagewindow, also in the XML file when I save.

Is there a way to use pattr to save strings? Or should I be looking at something else?


April 2, 2009 | 9:37 pm

Wait, I need to use a textedit field, not a message. That seems to work fine.

Now next question – I am specifying a filename in the write message that goes to pattrstorage, eg "write bsl"

This gives me an error from pattrstorage, "could not create file (-1)"

What could be the problem? I absolutely need for the patch to read and write from its file without ever prompting for a name.


April 2, 2009 | 10:14 pm

Have you looked at the savemode attribute of pattrstorage? Set it to savemode 3 for no prompting. Try to save the file manually first by just sending a "write" message, or make sure the file you try to save, "bsl", already exists.


April 3, 2009 | 12:04 pm

Thanks, that’s helpful! @savemode 3 is not documented however, I can only see savemode 0 – 2 listed in the reference.


April 3, 2009 | 12:26 pm

You’re right, it’s missing in the reference! It’s in the help file, in the patcher savemode.
J-F.


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