fbc icon indicating copy to clipboard operation
fbc copied to clipboard

The default value of the parameter was passed incorrectly when calling the pointer function.

Open skyfish4tb opened this issue 4 years ago • 0 comments

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

skyfish4tb avatar Oct 29 '22 02:10 skyfish4tb