G.KeyValuesToTable
From GMod Wiki
This function is being moved to the util library once the GMod Beta 13 update becomes public |
Function | |
Syntax |
KeyValuesToTable( String text (key-values) ) Where is this used? |
Description: | |
Returns a table from a key-value string. | |
Returns: | Table |
Part of Library: | Global Functions |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.KeyValuesToTable]G.KeyValuesToTable [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Additional Notes
- All keys are transformed into lowercase.
- All keys and values are converted to strings. This can be fixed by putting a tonumber() around the table indexes.
- This method of data storage is now considered deprecated. It is recommended to use GLON. GLON can encode/decode all types of data and does not return keys as lowercase. Unfortunately, the encoded data is no longer human-readable, but this only means the files can't be edited externally - it is much more efficient in all other manners. Remember to use require("glon").