Timer.CancelCall(AddressOf partyTime) // Do we care here?
Timer.CallLater(2000, AddressOf partyTime)
Does it matter if I’m cancelling a call even if there was never one made?
The purpose of the above code is to allow me to call partyTime repeatedly and every time it’s called, we wait another 2 seconds. Then 2 seconds after things calm down its partyTime! Of course, it could be called just once.
On windows, no exception (32/64 bit both) no nothing. That’s great since exceptions are SLOW and these calls may be required to be fast (animations etc).
It should be ok but the only thing I’d recommend is to wrap it all in a Try to check for IteratorException which I’ve seen happen.
It would be nice if this was documented (<https://xojo.com/issue/57720>) as you’d only ever know about checking for it when your program randomly broke.
I’ve not done any performance testing on Try’s to offer an opinion either way, but if its just in a UI update system somewhere I wouldn’t worry about the performance hit.
I guess error “0” is just a warning about the use of the underlying dictionary. But kind of looks like a bug. How could you mutate the underlying dictionary while calling a CancelCall? But now we know we MUST use try catch and ignore such “warning”. But I’m highly curious on why this happens because it may be related to more bugs, or it’s ok, and the warning message is just plain wrong and could be something like “Handler pointer not found”.
Its an error not a warning, the 0 is there because no error number is returned with the error. The error message is perfectly valid for what I suspect is happening which is the loop that clears the dictionary down yields allowing modification of the dictionary while its being cleared.