I have a problem with elseif, which is used in Lua function. I am using LuaEdit 2010 on Windows and in case of first code, the program freezes. The second one works but is pretty ugly and incase of more elseifs also pretty unusable. I think it should be working in both cases but its not and I have no idea why, please help me. Lua Edit seems like the function is not closed. This code is not working
function read_this()
char=read_char()
word=""
if char=="~" then word = word..char
char=read_char()
if char == "+" then
formating=true
word=word..char
elseif char == "-" then
formating=false
word = word..char
else word = word..char
end
write(word,file2)
else print("something what is not problem")
end
end
This code is working for me.
function read_this()
char=read_char()
word=""
if char=="~" then word = word..char
char=read_char()
if char == "+" or char == "-" then
if char == "+" then formating=true end
if char == "-" then formating=false end
word = word..char
else word = word..char
end
write(word,file2)
else print("something what is not problem")
end
end