Shop OBEX P1 Docs P2 Docs Learn Events
Responding to an object comment on Memory Storage Management — Parallax Forums

Responding to an object comment on Memory Storage Management

Bobb FwedBobb Fwed Posts: 1,119
edited 2012-01-12 16:04 in Propeller 1
I got a comment on my Memory Storage Management object, and I would like to address it here (since it was anonymous, I don't know whether they will get the object response).
Can you provide instructions on how to use this in its most basic form? After reviewing the demo 1 and demo 2 its still not clear how this operates. I think the demo has to much going on. Not sure where to sort through the busy demo to get to the heart of what is happening. Stop Replying

In it's simplest form, you need to initialize the object with init (you only do this once, each time the Propeller is booted). Then use one of the create_X methods (eg: create_long(string("any name"), 5566)). This actually stores the value to the EEPROM.

To get the value back, use one of the get_X methods (eg: get_long(string("any name"))) to get the value back. As long as the "name" in the string for both method calls are the same, the value is stored and accessed from the same location.

Past that, it get's a little more complicated in an attempt to make things simpler :-). The check_edit_create_X methods are recommended when there is a possibility that the value may or may not already exist, So you don't have to keep track of using the create_X vs. edit_X methods.

The get_dec method allows you get any stored decimal value, regardless of size (so you wouldn't have to track byte/word/long sizes).


I know the object is a bit complicated (lots of PUB methods), it probably would help to start with the lightweight version since it has less methods, and forces you to use the check_edit_create_X and get_dec.

Please let me know if anyone has any more questions on how to use this object.
In the next release, I will try to remember to include a "super simple demo" that contains only an example or two of the most fundamental methods.
Sign In or Register to comment.