fork from http://sourceforge.net/projects/opascalscript/