I made exactly same function for one of my old games. I didn't use OPTION STRICT,so my version doesn't have VAR statement. Othar than that, it is almost same (mine uses S$ for the name of string parameter)