How to track the changes of an order status programmatically?

Hi there,

how can i track, if a orderstatus is changes programatecally?
what i want to do is to set a value in a custom table in case of a certain order status change. a am very new to magento and cant really find out how and where to do this?

i appreciate any help

best regards Ludwig

You should learn about events: