Store changed values on quit without external file

bkshepard's icon

I'm probably overlooking something really basic, but is it possible to have either pattr or pattrstorage retain a changed value on quit without writing to an external file?

pdelges's icon

If you save your .maxpatch before quitting Max , pattr will keep its value. Make sure "Restore Saved Value at Patcher Load" is checked it the inspector.

Max Patch
Copy patch and select New From Clipboard in Max.

If you open the following patch , the number box should display -55, which is saved in the pattr hop instance.

bkshepard's icon

Hi Patrick,

Thanks, but what I'm trying to do is have it store without making the user save the document. I'm working on a standalone app that I want the user to be able to enter some information and have that information retained for subsequent launches of the app.

spectro's icon

Reading your request literally, I don't think there is a way to do this *without* writing to an external file or modifying the patch, however it is entirely possible to automate the process of writing a preset file so the user does not need to be involved.

Max Patch
Copy patch and select New From Clipboard in Max.

There's probably be a more elegant way to do this. This example requires the manual creation of the preset file in the first instance.

David Beaudry's icon

Try storing your values in message boxes (prepend set >> message box, or use the right inlet), then on load, use a loadbang connected to the same message box to pass the data along.

It should do what you want...I think...

David

bkshepard's icon

Thanks for the suggestions,

@spectro my concern is I'm wanting to allow folks to change the administrator password to a standalone and I don't want it in an external file where someone could access it.

@David wouldn't that still require a save function?

David Beaudry's icon

oops. drr. yes, it would. i thought i was being so clever ;)

AudioMatt's icon

MaxObject.embedMessage

/I'm to tired to make something with it right now

pdelges's icon

Couldn't you save your sensitive datas in a coll or text file with some encryption algorithm, and decipher the file when needed?

bkshepard's icon

@AudioMatt: is embedMessage a 3rd-party external? I'm not familiar with it.

@Patrick: coll was actually my first thought, but I couldn't get the data to stick without either saving or writing to an external file. It's beginning to look like I need to explore some sort of data encryption as you suggest.

Tj Shredder's icon

You can't avoid the encryption. Collective files and even standalones would also be readable with a normal text editor...