Store changed values on quit without external file

Feb 6, 2011 at 8:50pm

Store changed values on quit without external file

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?

#54769
Feb 7, 2011 at 2:27pm

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.

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

– Pasted Max Patch, click to expand. –
#197178
Feb 7, 2011 at 8:40pm

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.

#197179
Feb 8, 2011 at 6:29am

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.

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.

– Pasted Max Patch, click to expand. –
#197180
Feb 8, 2011 at 7:07am

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

#197181
Feb 8, 2011 at 7:37am

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?

#197182
Feb 8, 2011 at 7:46am

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

#197183
Feb 8, 2011 at 7:54am

MaxObject.embedMessage

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

#197184
Feb 8, 2011 at 8:16am

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

#197185
Feb 8, 2011 at 6:32pm

@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.

#197186
Feb 8, 2011 at 6:55pm

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

#197187

You must be logged in to reply to this topic.