This procedure generally implements all functions of Notepad