Progress
Programming
Handbook
Adding Functionality to an Editor
The following example,
p-edit2.p
, provides a more functional editor thanp-edit1.p
. This example lets you read an operating system file into the editor, make modifications to it, and then save the results. To do this, the example uses a menu bar and the READ–FILE and SAVE–FILE methods of the editor widget:
When you run this example, you can use the menu items to read from a file or type text directly into the editor.
![]()
You can increase the functionality of this editor further by adding additional options to the menu bar and using additional editor methods. For example, you can add an Edit submenu that includes a search–and–replace option using the REPLACE method.
NOTE: When you save the editor text to a file, some characters save differently, depending on your operating system. For example, RETURN key input writes out on Windows as x0d0d0a. On UNIX, this writes out as x0d0a. Similarly, the end-of-line on Windows writes out as <CR><LF>. On UNIX, this writes out as <CR> alone. Future versions of Progress might address these issues, allowing for improved portability among platforms.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |