I think I have found a bug when calling a function with optional params using a callback:
I think that this is new to 1.20 but I could be wrong - I have not regression tested in 1.10 or any of the 1.20 beta releases as yet
Code: Select all
Procedure Test(foo.i = 0)
If foo = 0
Debug "foo is zero"
Else
Debug "foo is " + Str(foo)
EndIf
EndProcedure
OpenWindow(0, 0, 0, 300, 300,"TEST", #PB_Window_ScreenCentered)
ButtonGadget(0, 100, 100, 60, 22, "Error")
BindGadgetEvent(0, @Test())
Debug "Passing in 0 to Test() ..."
Test(0)
Debug "Passing in nothing to Test() ..."
Test()
However, the debug output is in fact:
Code: Select all
Passing in 0 to Test() ...
foo is zero
Passing in nothing to Test() ...
foo is zero
foo is undefined