Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / Simple INI read/write

Author
Message
JasonPC
5
Years of Service
User Offline
Joined: 14th Apr 2015
Location: United Kingdom
Posted: 3rd Oct 2019 10:32
I've a project were I need the end user to create an INI file. I could only find a DarkBasic set of functions for this and failed at getting that working, so cracked on with my implementation.

My code loads the INI file into a string array for reading/writing.
There is also a function for writing it back out.

To keep the code small, I only cover String and Numerical (Float) data types.
There is some basic diagnostics, so if you ask to read a section/parameter that doesn't exist, it will flag it.
It should be fairly fast, I'm assuming most INI files won't be massive.

One thing I've love to trap is attempting to read a Numerical Value where the actual data is a string... AppGameKit reports "na", but I'm struggling to know the best way to detect that.

config.ini


Qugurun
Valued Member
5
Years of Service
User Offline
Joined: 8th Dec 2014
Location: Tyumen, Russia
Posted: 4th Oct 2019 00:41 Edited at: 4th Oct 2019 00:41
Here it seems to be decided https://forum.thegamecreators.com/thread/219867
https://www.instagram.com/qugurun/
JasonPC
5
Years of Service
User Offline
Joined: 14th Apr 2015
Location: United Kingdom
Posted: 4th Oct 2019 11:25
Doh!

I did use the forum search.... honest...

But, it didn't take that long. I'll check out (and probably use that version.

My code won't create sections or values, and that would be a bonus.

Thanks!

Login to post a reply

Server time is: 2020-08-03 16:33:00
Your offset time is: 2020-08-03 16:33:00