If you point us to C based example we might be able to help you translate it to Pascal.