Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

<eof> Error.
Started by aliaymaneltantawy Dec 31 2018 05:46 AM

5 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

aliaymaneltantawy

[GLOBAL: userInfoPane.html]
aliaymaneltantawy
  • Observer

  • 11 posts
  • Corona SDK

There is an error '<eof>' expected near end. But there is no ends are written wrong.



[TOPIC: post.html]
#2

aliaymaneltantawy

[GLOBAL: userInfoPane.html]
aliaymaneltantawy
  • Observer

  • 11 posts
  • Corona SDK

Please, can anyone help me?



[TOPIC: post.html]
#3

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,659 posts
  • Corona SDK

If there were no mistakes, you wouldn't be getting an error. Post the code, and then someone can help.


  • aliaymaneltantawy likes this

[TOPIC: post.html]
#4

aliaymaneltantawy

[GLOBAL: userInfoPane.html]
aliaymaneltantawy
  • Observer

  • 11 posts
  • Corona SDK

local widget = require("widget")

local function handelbuttonEvenet( event )
    local phase = event.phase
 if "ended" == phase then
     print("Mission success")
 end
end

local PauseButton = widget.newButton ( "Pause", "Pause 1", 150, 200, 350, 150)
onEvent = handelbuttonEvenet( event )


[TOPIC: post.html]
#5

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 432 posts
  • Corona SDK

There's plenty to fix there. I'd recommend that you go read about how to create and use widget.newButton in the documentation: https://docs.coronalabs.com/api/library/widget/newButton.html

 


  • aliaymaneltantawy likes this

[TOPIC: post.html]
#6

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,463 posts
  • Corona SDK

1. I agree with @XeduR  you need to take a look at the API and other docs for widget.

The code you provided will not work to create a button and has a number of errors and incorrect syntax issues.

 

2. The reason you got that error message is the last line 

onEvent = handelbuttonEvenet( event )

Corona probably interprets this (via Lua) as you trying to create a function but not adding an end to it.  

 

 

Again, please go read the API docs and use some of these examples verbatim, then modify them a little bit at a time till you understand how it works.

 

Cheers,

Ed


  • aliaymaneltantawy likes this


[topic_controls]
[/topic_controls]