3
Well I’m learning moon and I’m having a doubt, I’m trying to create the reading of a bool function on moon.
I have a function that disables or activates as I mark true or false.
This function is called useappenabled
only that I am not able to apply it in moon, before I used in libconf format and it worked normally before it was written as follows.
On the moon is as follows the function:
Enableapp =
{
Useapp = true;
};
Now the reading before in libconfig format was the following, note that the useappenabled function is applied the input value, either true or false if I put in the Useapp
if (config_lookup(&onf, "Enableapp"))
if (config_setting_lookup_bool(cf, "Useapp", &SelectValue))
useappenabled = SelectValue;
Then I tried to change the libconfig code to moon, however I am not able to read the function useappenabled
, the code is as follows on the moon
lua_getglobal(L, "Enableapp");
lua_pushstring(L, "Useapp");
lua_tonumber(L, useappenabled);
I think the problem is lua_tonumber, I would need to do something more or less like this:
useappenabled = value_de_Useapp;
But I’m starting now, can anyone tell me how I can apply the function useappenabled
to be equal to the value of Useapp
.