Code: Select all
text replace(getkey(, "General"), chr(0), <crlf>);Code: Select all
text replace(getkey(, "General"), chr(0), <crlf>);getsectionlist()
Returns a list of sections in an INI file or a list of 'key=value' pairs for the specified section.
Syntax[code]getsectionlist([section], [INIfile], [separator=CRLF])[/code] section [optional] The name of the section.
If omitted a list of sections is returned.
INIfile [optional] The name of the INI file. Expects a filename
with extension, and can be absolute or relative to the
running script's path.
If omitted XYplorer's current INI file is used.
separator [optional] Separates the items in the returned list.
Defaults to CRLF (line feed).
return The list of sections or 'key=value' pairs in the
specified section.
Examples[code]text getsectionlist();[/code] Displays the list of sections in XYplorer's current INI file.[code]text getsectionlist('General');[/code] Displays the list of 'key=value' pairs in the 'General' section of
XYplorer's current INI file.[code]"Show Settings"
$file = 'C:\Config\Settings.ini';
$contents = '';
foreach ($section, getsectionlist(,$file), <crlf>) {
$contents = $contents . "[$section]<crlf>";
$contents = $contents . getsectionlist($section, $file) . <crlf 2>;
}
text $contents;[/code] Displays the contents of the 'C:\Config\Settings.ini' file.Even the part about the 3rd argument being separator and also broken?admin wrote:Perfecto!
OhTheQwerty wrote:Even the part about the 3rd argument being separator and also broken?admin wrote:Perfecto!
Currently, it's really more of a removeSeparators flag.
Will be added later. (Thanks to TheQwerty it's just a copy-paste job for mebinocular222 wrote:Cannot find in Change log nor Help > Scripting Commands Reference![]()
This sas secretly added?
You shouldn't have copied directly from that TheQwerty guy he's making your documentation look bad:admin wrote:Will be added later. (Thanks to TheQwerty it's just a copy-paste job for mebinocular222 wrote:Cannot find in Change log nor Help > Scripting Commands Reference![]()
This sas secretly added?)
::help 'idh_scripting_comref.htm#idh_sc_getsectionlist'; wrote:INIfile [optional] The name of the INI file. Expects a filename with extension, and can be absolute or relative to the to the running script's path.
*Broken - currently just removes the separator between
items when set.
Thanks I updated the forum docs.admin wrote:At least I remembered to remove this:*Broken - currently just removes the separator between
items when set.