Progress
Programming
Handbook


Defining an Editor

The following form of the VIEW–AS phrase defines an editor:

SYNTAX
VIEW-AS EDITOR 
  {     size-phrase
     |  INNER-CHARS char INNER-LINES lines 
  }
  [ BUFFER-CHARS chars ]
  [ BUFFER-LINES lines ]
  [ LARGE ]
  [ MAX-CHARS characters ]
  [ NO-WORD-WRAP ]
  [ SCROLLBAR-HORIZONTAL ]
  [ SCROLLBAR-VERTICAL ]
  [ TOOLTIP tooltip ] 

When viewing a character string as an editor, you must specify a size for the editor in one of two ways:

You can optionally limit the number of characters that the user can enter or that can be displayed within the editor by specifying the MAX–CHARS option or setting the MAX–CHARS attribute. You can also enable horizontal scrolling (thereby disabling word-wrap) and display scroll bars.

On Windows, you can specify an editor that handles larger quantities of text than normal using the LARGE option. For more information, see the "Using an Editor" section.

The p-edit.p procedure displays the cat–description field of the item table as an editor that is 30 characters wide and 5 characters long:

p-edit.p
FORM 
   item.item-num item-name item.price on-hand
   allocated re-order on-order cat-page
   item.cat-description
      VIEW-AS EDITOR SIZE-CHARS 30 BY 5
   WITH FRAME x SIDE-LABELS.
   
FOR EACH item:
   UPDATE item WITH FRAME x.
END. 

When you run p-edit.p, the screen appears as follows:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095