Saving variables for later use

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving variables for later use

Thermo
If I want to save variables for later use, what is the best option? Right now I am writing to a text file, but as the number of variables I need to save grows, I need to either keep track of the line number, or make something that parses the text file. Is there an easier way of saving variables than writing to text files?
Reply | Threaded
Open this post in threaded view
|

Re: Saving variables for later use

fschmidt
Administrator
If these are config variables then you can put them in a table and save the table to a text file as Luan or JSON.  If they are dynamic variables then you can save them to Lucene which is the database.  If you tell me which you prefer, I can post a code sample.
Reply | Threaded
Open this post in threaded view
|

Re: Saving variables for later use

Thermo
These are config variables so I am curious about the table option. Basically, I want it to remember the value that was last entered into a small text field, rather than the text field be blank the next time the page is loaded. It should be done on the server side because it represents a real change on the device.
Reply | Threaded
Open this post in threaded view
|

Re: Saving variables for later use

fschmidt
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: Saving variables for later use

Thermo
I have incorporated this into my code, thank you.