Save an Object or Array variable in the app's local storage


Ava Rashidi

Hello David,

I have NewObject that I want save this in local storage, Is there a function in AB like SetOption in array to save object in local storage? or i should use java script like this:

I look forward to hearing from you.

Thank you,


DecSoft

Hello Ava,

Yes; of course, in addition to the Javascript code that you suggest (which is possible to use in both cases: to save the option, and to convert the object to an string: we need to remember here that we can use pure Javascript without problems in any part of the app), you can use the StrSerialize action, and then the SetOption one. That is, StrSerialize can convert an Object or Array into an string, which you can save into the local storage using the SetOption action.



Ava Rashidi

StrSerialize action is great! I did not know about this, It made me easy.

Thank you so much for your good guidance,


DecSoft

You're welcome Ava!

Don't forget the counterpart of the StrSerialize action, which is the StrUnserialize action. For your convenience, here is the online help file, with all the actions' references. Remember that the program also include the help, and, we can just press any action from the actions' list (in design time) or just the action's editor form help button, in order to directly open the help with the appropriate actions' reference.



Ava Rashidi

This is quite true, Thanks for your reminders.

An early reply would be appreciated.

Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.