Creating an ini file

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
remco.remco
Newbie
Posts: 12
Joined: Wed Jul 06, 2016 12:19 pm

Creating an ini file

Post by remco.remco » Tue Oct 04, 2016 11:47 am

Hi,

I want to make an ini.txt file because I discovered that sometimes I would like to change a setting/variable without the need for updating the code. I have for instance these variables:

let>ReadActions=5
let>ErrorMax=3
let>NoLog=45

They are now in my code. I want to remove them there. And I want to make an ini.txt file like this:

ReadAction 5
ErrorMax 3
NoLog 45

The names of the variables and their values are separated by TABS. Now I want my script to read for instance the string ReadACtion and its value 5. Call them read1 and read2

So after reading it:

read1=ReadAction
read2=5

And then I want to define:

let>%read1%=%read2%

Is this syntax allowed and does it effectively yield to : let>ReadAction=5?

Kind regards,
Remco

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Creating an ini file

Post by Marcus Tettmar » Wed Oct 05, 2016 1:39 pm

That's easy using these functions:

ReadIniFile
EditIniFile
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts