Config class + Json file
Posted
#1
(In Topic #680)
Regular

I would like to present you a method to manage the configuration of a program, which I find interesting.
Together with TercoIDE we prepared this example in which in a class there are all the parameters of a program and with great flexibility can be added more. Then in any other part of the program you can read and write those variables.
Finally there is a method (Save) that goes through the symbols of the class and saves them in a text file in json format for future use by retrieving this data with the "Load" method.
Please feel free to give your opinion, comment or improve this program.
Config.class
Code (gambas)
- ' Gambas class file
- ''Configuration variables to be saved, add as needed below
- '' Verifying that it is a property or a variable.
- jConfig.Add(Valor, var)
For example in a form…
Regards.
Martín.
1 guest and 0 members have just viewed this.





