If you've ever used INI to store data (which is built into AHK), then you'll know the basics of using Java's Properties.
Here's a basic run down:
# I'm a comment!
variable_name = Some Data!
another_variable = Some More Data!
im_true = true
im_false = false
im_nothing = null
multi_line_string = I take up \
single_line_str = There's a\nSnake in my\nBoot!
# These are objects, no need to define it before setting the info:
object.name = Megaman
object.index = 1
object.is_content = true
another_object.is_new = true
That's it. No need to create a line before the definition, no fancy curly brackets surrounding a bunch of stuff. Nothing.
Just define the path of the object and go!
To read and write your data to and from files it's as easy as doing this:
Gist Page for the Class.
Code: Select all
; Read a file into an object. MyObject := Properties.Parse(A_ScriptDir . "\settings.cfg") ; Save an object to a file. Properties.Dump(MyObject, A_ScriptDir . "\settings.cfg")
NOTE: I have only added the \u escapes for Parse not for Dump yet, so keep that in mind.