-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|631|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> File Access


 
flying_cucco
Created : 25 October 2009
Edited : 25 October 2009
System : Windows
Language : Cobra

Settings

Manage ini files

Download

A simple unit to load a set of key=value pairs from a file, manipulate them in your program and save them again.
It supports multiple files so you could have separate defaults and user profiles, and tracks which values have been modified so you could save the changes only to the user file.

Exported functions:
LoadSettingsFile(filename)
SaveSettingsFile(filename)
ReadSetting(key, byref value)
ReadSettingReal(key, byref value)
ReadSettingInt(key, byref value)
WriteSetting(key, value)
FreeSetting(key)
FlushSettings

Exported variables:
settings_associator = "="
settings_comment = "#"
settings_backup = ".bak"

 

Comments