It is pretty simple really ... I'm sure darkeagle / swift and others have examples in the archives or over at bcoder.
In fact here's one ..
http://www.blitzbasic.com/codearcs/codearcs.php?code=670
In fact here's one ..
http://www.blitzbasic.com/codearcs/codearcs.php?code=670