Timer is deprecated. You should use Timer instead?

While bringin Code from API1 to API2, i see Timer is deprecated. You should use Timer instead messages.

f.e. in this line
Xojo.Core.Timer.CallLater( 2500, AddressOf pic_freeACSStatusDot, &cC0C0C000 )

but a simple
Timer.CallLater( 2500, AddressOf pic_freeACSStatusDot, &cC0C0C000 )

brings a There is more than one method with this name but this does not match any of the available signatures. error.

I have some problems finding the proper way to do it in API2. Can someone please point me to the correct direction?

Timer.CallLater should be right.
Maybe a Using clause for “Xojo.Core” or anything like that?

This works:

Timer.CallLater 50, AddressOf TimerAction

Private Sub TimerAction()
End Sub

Thank you @StefanA but i had a poor example. My issues happen only with Methods which need parameters. I’ve updated my example.

The parameter now has to be a Variant:

1 Like

Excellent. It works like a charm! :slight_smile:
Thank you @StefanA

1 Like