You have a syntax error

EndfunctionFunction WriteLog($text)

needs to be

Endfunction

Function WriteLog($text)
_________________________
Home page: http://www.kixhelp.com/hb/