I run the program and writes

'=' expected near 'while' 

Program code

 local menu = none, admin exit, finc while true do io.write("> ") err, finc = pcall(io.read) elseif finc == admin then break end 
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

the form

 переменная1, переменная2 = значение1, значение2 

used in lua for "group" value assignment :

переменная1 will get значение1 , переменная2 be значение2 .

I suspect that this line:

 local menu = none, admin exit, finc 

you wanted to assign the string "none" to the menu variable, admin - the string "exit" , and just declare finc as local. then it was necessary to do something like this:

 local menu, admin = "none", "exit" local finc