Hi everyone,
I am using the preference library to save some data and it works great with the examples they have posted. But I want to save some string that is from a variable. So I did the following and it returns nil. Can anyone tell me why? Or how to use a variable here?
Here is the link to the page: https://github.com/SatheeshJM/Lua-Preference-Library
Thanks!
--Store strings local apple = "abc" preference.save{b=apple} value = preference.getValue(b) print("Retrieving string : ",value)
The example on the page shows how to use it like this:
local preference = require "preference" --Store numbers preference.save{a=1} value = preference.getValue("a") print("Retrieving number : ",value) --Store strings preference.save{b="1"} value = preference.getValue("b") print("Retrieving string : ",value) --Store Boolean preference.save{c=true} value = preference.getValue("c") print("Retrieving boolean : ",value) --Store Tables preference.save{d = {1,"2",true}} value = preference.getValue("d") print("Retrieving table : ",value)
I am using the same way as storing strings but using a variable instead. How can I do this?
Thanks!!!