Recent

Author Topic: Using TJSONPropStorage to save and restore a form  (Read 1121 times)

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 559
Using TJSONPropStorage to save and restore a form
« on: August 28, 2024, 09:16:50 pm »
The TJSONPropStorage component allows me to save and restore the fields of a form in a file, and it works great. I would like to be able to save and restore my form from a string though, rather than from a file (the JSON properties are stored in the file as a single string if I use the "unformatted" property).  Is there an easy way to do this? I'll try to figure this out for myself if anyone can point me to the source for the component.  Any pointers appreciated.  (I'm trying to combine a number of setup files into one single file in my project).

n7800

  • Full Member
  • ***
  • Posts: 173
Re: Using TJSONPropStorage to save and restore a form
« Reply #1 on: August 31, 2024, 12:04:18 am »
I'll try to figure this out for myself if anyone can point me to the source for the component.  Any pointers appreciated.

Sources? Just right-click on the TJSONPropStorage type in the code editor and select the first menu item "Find declaration of TJSONPropStorage". This will open the unit "lazarus/lcl/jsonpropstorage.pas" in which this class is declared.

dsiders

  • Hero Member
  • *****
  • Posts: 1282
Re: Using TJSONPropStorage to save and restore a form
« Reply #2 on: August 31, 2024, 12:17:52 am »
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 559
Re: Using TJSONPropStorage to save and restore a form
« Reply #3 on: August 31, 2024, 01:58:03 am »
Thank you for the inputs.  I've implemented a kludge that lets me use the JSON properties from a string rather than from a file, and will try to replace this with something better later.

 

TinyPortal © 2005-2018