There's nothing built in; you have to write code to do this sort of thing.