Jump to content




'end' expected error


  • You cannot reply to this topic
3 replies to this topic

#1 TheNic2001

  • New Members
  • 1 posts

Posted 02 April 2015 - 02:28 PM

how to fix this error?
bios:367: [string "display"]:52: "end" expected (to close "while" at line 10)

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 April 2015 - 03:12 PM

Split into new topic.

Without seeing your code, the best we can do is point you to the list of common errors.

#3 Square789

  • Members
  • 39 posts
  • LocationUniverse:C:/MilkyWay/Sol/Earth/Europe/Germany

Posted 02 April 2015 - 03:46 PM

That means you forgot to close a while loop in your program.

I recommend to shift every structure that has to be ended with an "end" forward with a tabulator like this:
while true do
  ev, p1, p2 = os.pullEvent()
  if ev == "key" then
    print("You pressed a key")
  elseif ev == "char" then
    print("You pressed a key")
    print("With char event")
  else
    print("You fired another event.")
  end
end

But, as Lyqyd said, you can be helped best when you post the program.

Edited by Square789, 02 April 2015 - 04:17 PM.


#4 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 02 April 2015 - 05:56 PM

Actually, it means you forgot to close anything requiring an end, ei for, if, function, etc.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users