Callback compiles without ()

Just starting out? Need help? Post your questions and find answers here.
e2robot
Posts: 38
Joined: Wed Mar 19, 2014 8:34 am

Callback compiles without ()

Post by e2robot »

Code: Select all

Enumeration
  #window
  #button1
 
EndEnumeration  

Procedure button_pressed()
  Debug "Pressed"
    
EndProcedure

OpenWindow(#window,10,10,200,200,"TEST")

ButtonGadget(#button1,20,20,30,20,"GO")
BindGadgetEvent(#button1,@button_pressed,#PB_EventType_LeftClick)

The above will compile but doesn't work as the callback should be @button_pressed()

This should produce a compiler error or warning

Thanks,
Phil
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Callback compiles without ()

Post by Peter »

not a bug. Same as http://forums.spiderbasic.com/viewtopic.php?f=11&t=1256

Greetings ... Peter
falsam
Posts: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Re: Callback compiles without ()

Post by falsam »

e2robot wrote:This should produce a compiler error or warning
Yes, you're right. The PureBasic IDE displays the warnings. This is not possible with SpiderBasic.

Click the GO button and open the browser debugging console. Errors are displayed.
Last edited by falsam on Wed Aug 23, 2017 9:10 am, edited 1 time in total.

➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

Sorry for my poor english
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Callback compiles without ()

Post by Peter »

@falsam: or use EnableExplicit. ;-)

(this should be mandatory)

Greetings ... Peter
falsam
Posts: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Re: Callback compiles without ()

Post by falsam »

Peter wrote:@falsam: or use EnableExplicit.

(this should be mandatory)
Yes ++ I totally agree with you.

➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

Sorry for my poor english
Post Reply