Page 1 of 1

Configuration manager writing to ini file

Posted: Fri Aug 21, 2020 2:20 pm
by mol
I wonder if someone has to share configuration manager, which will be configurable - not specific for his application, enable to write selected setting to .ini file (or xml or any else)?
If not, Im starting such a new job.
I want to declare sections, variable in section, variable types, variable ranges and which local or private variable must be se while read from .ini file.

Re: Configuration manager writing to ini file

Posted: Fri Aug 21, 2020 4:54 pm
by serge_girard
Interesting ! Can you please explain a bit more?

Serge

Re: Configuration manager writing to ini file

Posted: Fri Aug 21, 2020 7:03 pm
by mol
I'll try prepare some code next week.
I couldn't sleep last night and I thought a lot about this topic.
But, at weekend I don't like to work :-)

Re: Configuration manager writing to ini file

Posted: Sat Aug 22, 2020 7:20 am
by serge_girard
ok ! Have a nice weekend!

Serge

Re: Configuration manager writing to ini file

Posted: Sat Aug 22, 2020 12:50 pm
by trmpluym
Hi Marek,

I do not exact know what your idea is. But in some of my programs I use something like :

Code: Select all

MEMVAR cEmailType:="DefaultValue"

if !File("program.ini")
   Begin ini file ("program.ini"")
   Set Section "INVOICE" ENTRY "EmailType" To cEmailType
   End ini
else
   Begin ini file ("program.ini"")
   Get cEmailType Section "INVOICE" ENTRY "EmailType"
   End Ini
endif
And I use a menu item to change the settings:

Code: Select all

EXECUTE FILE GetStartUpFolder() + '\' + 'Program.ini'
Theo