Thanks! That was excactly what I was looking for! Only downside is the use of SysUtils etc. but that could be fixed though thanks again.