I have a condition where in my lua script I want to use enum like for SUCCESS I can give 1 and for FAILURE I can give 0 I am using lua version 5.2.4 Can anyone please help me on how to use enum I want to use enum
elseif(cc_config_cmd == "DELETE" and file_found==1)then
api:executeString("callcenter_config queue unload " .. queue_name)
stream:write("1")
else
stream:write("0")
end
There are no enums in Lua.
Simply define variables.
SUCCESS = "1"
FAILURE = "0"
stream:write(SUCCESS)
Or put it into a table which would be quite similar to enum style syntax.
Result = {SUCCESS = "1", FAILURE = "0"}
stream:write(Result.SUCCESS)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With