You have two fucking threads asking for the same thing....
No one will give you one just so you can copy paste it into "your" base -__-
Also, I don't mean to be picky, but it is technically a function or procedure unless it is in a class, and I would bet that "your" base uses minimal OOP.