Code: Select all
Prototype ProtoMax(Value, Print = #False)
Procedure Max1(Value, Print)
Debug "Max1 : " + Value
EndProcedure
Procedure Max2(Value, Print)
Debug "Max2 : " + Value
EndProcedure
Max.ProtoMax = @Max1() ; Set the function pointer
Max(10)
Max.ProtoMax = @Max2() ; Change the function pointer
Max(20) ; the function call doesn't change
Structure s_evenmore
f.ProtoMax
EndStructure
Structure s_more
f.ProtoMax
evenmore.s_evenmore
EndStructure
Structure tst
f1.ProtoMax
f2.ProtoMax
more.s_more
EndStructure
*struct.tst = AllocateStructure( tst )
*struct\f1 = @Max1()
*struct\f2 = @Max2()
*struct\more\f = @Max1()
*struct\more\evenmore\f = @Max2()
*struct\f1(30)
*struct\f2(40)
*struct\more\f(50)
*struct\more\evenmore\f(60, #True)