Skip to content
Snippets Groups Projects
Commit f776273d authored by rswindell's avatar rswindell
Browse files

get() will now return the 'deflt' arg value (e.g. undefined) rather than

false if the .ini file can't be opened (e.g. doesn't exist).
set() will now return the result of File.iniSetValue() rather than the
result of File.close().
parent 974e6311
Branches
Tags
No related merge requests found
......@@ -11,7 +11,7 @@ function get(section, key, deflt, usernum)
usernum = user.number;
var file = new File(filename(usernum));
if(!file.open('r'))
return false;
return deflt;
var result;
if(!section)
result = file.iniGetAllObjects();
......@@ -30,8 +30,9 @@ function set(section, key, value, usernum)
var file = new File(filename(usernum));
if(!file.open(file.exists ? 'r+':'w+'))
return false;
file.iniSetValue(section, key, value);
var result = file.iniSetValue(section, key, value);
file.close();
return result;
}
this;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment