cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to save data?

heyo
Senior

Hello everyone, I want to ask what is the best way to save data. I understand that I need to use Model to save. I am kind a new in c++ programming so maybe there is a way to save data in model structs? Can someone help me?

for example I want to save all these selected text to model:

0693W00000WL5vbQAD.pngI'm using functions which goes to presenter and when save to model. But I save this texts one by one and it becomes mess. In my project will be a lot of configuration data and I need to somehow save it.

1 ACCEPTED SOLUTION

Accepted Solutions
Yoann KLEIN
ST Employee

Hello @heyo​ ,

Why not saving all these string values in 2-dimensional Array ? With the first element as your data name and the second as the string you want to save.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX

View solution in original post

5 REPLIES 5
Yoann KLEIN
ST Employee

Hello @heyo​ ,

Why not saving all these string values in 2-dimensional Array ? With the first element as your data name and the second as the string you want to save.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX

It is possible to save these arrays in model?

Save it where?

FLASH, BKPRAM, SDCARD, permanently?​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Just in microprocessor RAM. But I understand that I need to store it in model.hpp. Because when I save it I need to depict in other screen.

What do you mean by save exactly @heyo​ ?

One purpose of the model is to interact with the different screens of your application and synchronize variables values, to be sure to populate the different UI with the same values. If you want to use the array I suggered, you simply have to declare an array in the model and send values from the UI through the Presenter to store your string values.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX