glon.encode

From GMod Wiki

Jump to: navigation, search
Function
Syntax glon.encode( Var data_to_serialize )
Where is this used?
Description:
Serializes the given data. (Should be called using pcall)
Returns: String encoded_data
Part of Library: glon
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Glon.encode]Glon.encode [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionEncode and write a table to a file
Used onNewerServer.png
Code
 local my_table = {}
my_table["health"] = 42
my_table["name"] = "Fred"
my_table["extra"] = {}
 
writeme = glon.encode(my_table)
file.Write("mysavelocation.txt", writeme)
OutputText file in the data folder encoded in GLON.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox