Invoking the Program Editor

You invoke the program editor when you create a new object or open an existing object of type program, class, subprogram, function, subroutine, capacity, helproutine or text.

This section provides instructions for invoking the program editor.

Start of instruction setTo invoke the editor for a new object

  • From the Object menu, choose New and the type of object (for example, program) you want to create.

    Or:
    In the library workspace, select the required library node, invoke the context menu and choose New Source and the type of object you want to create.

    Or:
    For an object of type program, press CTRL+N (shortcut keys are not provided for other object types).

    Or:
    Choose the toolbar button that corresponds to the type of object you want to create (toolbar buttons are not available for all object types).

    Or:
    In the command line, enter the following system command:

    EDIT object-type

    where object-type is the type of object to be created.

    For example, to create an object of type program, enter the following:

    EDIT PROGRAM

    Or:
    Use the type code (here: P) that corresponds to program::

    EDIT P 

    For detailed information on the command syntax, see EDIT and object-type in the System Commands documentation.

    The program editor is invoked and an empty editor window similar to the example below appears for the selected object type:

    The title bar of the editor window displays the name and the type of the object (here: Program). If the object is new and has not yet been saved as a source object, the object is named Untitled1 where 1 denotes that this is the first editor window that has been opened for a new object during the current Natural session. Each additional editor window for a new object increments the number assigned to Untitled by one.

Start of instruction setTo invoke the editor for an existing object

  • From the library workspace or application workspace, select the object you want to open, invoke the context menu and choose Open.

    Or:
    Double-click on an object.

    Or:
    Select an object and choose the following toolbar button:

    graphics/pgm_win_open.png

    Or:
    In the command line, enter the following system command:

    EDIT object-name

    where object-name is the name of an existing source object.

    For example, to modify an object with the name PGMTEST, enter the following:

    EDIT PGMTEST

    For detailed information on the command syntax and object-name, see EDIT in the System Commands documentation.

    If the specified object exists in the current library and system file, the program editor is invoked as shown in the following example:

    The source code of the specified object is contained in the editor window where the current line is highlighted (default). You can switch highlighting on or off or change the highlight color by setting the corresponding editor option as described in Program Editor Options in the Using Natural Studio documentation.