Implement 'textreset' and 'write' functions.