INI Files - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: INI Files (/thread-23.html) Pages:
1
2
|
RE: INI Files - Tim - 03-07-2011 Sorry im bumping an old thread but thought it would be silly to make a new one Is there a way to cycle through all the keys in an ini file and output the key name and the values within it? RE: INI Files - FakeTruth - 03-07-2011 Yes there is GetValue not only accepts strings, but also ID numbers; you can use GetValue(0, 0) to get the first value of the first Key Use GetNumKeys() and GetNumValues( KeyID ) to get the respective number of keys and values in those keys and cycle through all keys/values RE: INI Files - Tybor - 03-07-2011 (03-07-2011, 12:04 AM)Tim Wrote: Sorry im bumping an old thread but thought it would be silly to make a new one Sample code: PHP Code: for keyID = 0,IniFile:GetNumKeys()-1 do RE: INI Files - Tim - 03-07-2011 Thanks for the help guys RE: INI Files - Tim - 03-07-2011 Got a little confused with the for stuff but if anyone else needs this code and is easily confused by a three letter word, i used the same concept with repeat Code: local count = 1 |