Skip to content
Petr Schreiber edited this page Mar 12, 2016 · 1 revision

You can use this module for easy use of INI files in your scripts.

How to start using it

Place the thinBasic_iniFile.dll to Mod directory inside your thinBasic installation. Since then, you should be able to reference the module easily as:

uses "iniFile"

Examples of usage

To make work with multiple files easier, and to avoid specifying the file name over and over again, module provides simple object: ' -- Create new variable of type IniFile Dim config As IniFile

' -- Specify which file you want to manipulate
config = New IniFile(APP_SourcePath + "settings.ini")
 
' -- Write key to section using single method
config.SetKey("Screen", "Width", "1920")
 
' -- Read key from section with default value specified
String value = config.GetKey("Screen", "Width", "1920")

' -- or just as is (for not existing returns empty string)
value = config.GetKey("Screen", "Width")
 
' -- List sections
String sections = config.GetSections(",")
 
' -- List section keys
String screenKeys = config.GetKeys("Screen", ",")

##Where to get support Please join us at the heart of ThinBASIC - at official forums. There is dedicated discussion.

Clone this wiki locally