ISDBIniFile::Keys: Difference between revisions
Jump to navigation
Jump to search
(Specified the return value, see forum http://www.mediamonkey.com/forum/viewtopic.php?f=19&t=70998) |
(Added example) |
||
Line 9: | Line 9: | ||
Returns a list of strings composed with the key and value in a given section. The string has the format "key=value" (without quotes). | 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