Reading a .INI file

Anything about GOverlay and the devices supported

Reading a .INI file

Postby mcnin » Wed May 13, 2015 7:52 pm

I can't find any info on how to read values from a .ini file, so I was hoping someone could point me in the right direction.

Here is what I did.
First I made a file called 'values.ini'
The file contents look like this:
[values]
somedata=900

Then I set GOverlay to read the key somedata in section [values]. When I go to sensors, I see INI: Keys & somedata, but when I put that on the screen, nothing shows up. Shouldn't my value appear? Am I doing this wrong? Any help would be great or maybe a sample of a simple .ini file that I can use as a starting point.

mcnin
 
Posts: 6
Joined: Wed May 13, 2015 7:40 pm

Re: Reading a .INI file

Postby TheLaGmAn » Wed May 13, 2015 8:01 pm

For a file with the contents:
Code: Select all
[values]
somedata=900
someotherdata=100

Your settings on Sensors > INIData should look like this, one setting per line:

Code: Select all
Enabled
C:\path\to\your\ini\file.ini
values
somedata,someotherdata


Hit save, go to the LCDSysInfo Tab, add the somedata element in the "INI: Keys" sensors list, click on the element added and make sure that the width of the element has enough space to show the value, by default the text "900" should fit.

It should work, if it doesnt, look in the Debug tab and post the contents here to see if there is any error.
User avatar
TheLaGmAn
Site Admin
 
Posts: 967
Joined: Wed Feb 26, 2014 8:32 pm

Re: Reading a .INI file

Postby mcnin » Wed May 13, 2015 8:25 pm

Thank you so much. I was able to get it working. Turns out I had not specified the full path to the .ini file in GOverlay. So when I followed your instructions, which included the full path, I got it working. It's always the simplest of oversights that get you stuck. :D
Also, thanks for confirming the layout/syntax of the .ini file.

mcnin
 
Posts: 6
Joined: Wed May 13, 2015 7:40 pm


Return to About GOverlay



Who is online

Users browsing this forum: No registered users and 3 guests

cron