fbc
fbc copied to clipboard
The default value of the parameter was passed incorrectly when calling the pointer function.
When multiple function pointers of the same type are defined, their corresponding parameter initialization values are different, although their prototypes are the same. In this case, only the parameter initializers of the first function pointer will be used.
Type OptionalError Test1 As Sub(Byval value As Long=123) Test2 As Sub(Byval value As Long=456) Test3 As Sub(Byval value As Long=789) End Type
Sub Test (Byval value As Long) print value End Sub
Dim As OptionalError vOErr = ( @test, @test, @test ) vOErr.Test1() vOErr.Test2() vOErr.Test3()
'Output: ' 123 ' 123 ' 123