ISDBIniFile::Keys: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
No edit summary
 
(Added example)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{MethodDeclaration|SDBIniFile|ISDBIniFile|Property Get Keys(Section As String) As SDBStringList}}
{{MethodDeclaration|SDBIniFile|ISDBIniFile|Property Get Keys(Section As String) As [[SDBStringList]]}}


===Parameters===
===Parameters===
Line 8: Line 8:
===Property description===
===Property description===


Returns a list of all keys in a given section.
Returns a list of strings composed with the key and value in a given section. The string has the format "key=value" (without quotes).
 
 
===Example code===
 
This example splits the returned key string into a key and value.
 
<source lang="vb">
Set KeyValueList = SDB.IniFile.Keys("Appearence")
For i = 0 To KeyValueList.Count - 1
    KeyValue = KeyList.Item(i)
    Key = Left(KeyValue, InStr(KeyValue, "=") - 1)
    Value = Left(KeyValue, InStr(KeyValue, "=") + 1)
    ' Do something with key and/or value
Next
</source>


[[Category:Scripting|{{PAGENAME}}]]
[[Category:Scripting|{{PAGENAME}}]]

Latest revision as of 16:52, 7 April 2013

CoClass SDBIniFile, Interface ISDBIniFile

Property Get Keys(Section As String) As SDBStringList


Parameters

Name Type Description
Section String A section where to find all the keys.


Property description

Returns a list of strings composed with the key and value in a given section. The string has the format "key=value" (without quotes).


Example code

This example splits the returned key string into a key and value.

Set KeyValueList = SDB.IniFile.Keys("Appearence")
For i = 0 To KeyValueList.Count - 1
    KeyValue = KeyList.Item(i)
    Key = Left(KeyValue, InStr(KeyValue, "=") - 1)
    Value = Left(KeyValue, InStr(KeyValue, "=") + 1)
    ' Do something with key and/or value
Next