Version 6.3.8 for Windows
 —  Using Natural Studio  —

Managing Natural Objects

This document covers the following topics:


General Information on Copying and Moving Objects

This general information applies to the commands Cut, Copy and Paste and to drag-and-drop. Detailed information on how to copy and move objects is provided later in this section.

Note:
The Edit menu which contains the above commands is only shown when an editor window is currently active in the workspace. However, these commands can always be chosen (with the restrictions described below) from the context menu, from the toolbar or using a shortcut key.

You can copy and move nodes from the local environment to the remote environment, and vice versa.

You can copy and move nearly all of the nodes in the library workspace and in the various list views. This can be either a group node or a node for a single object. For example, you can copy all programs of a library by copying the Programs node which is available in the logical view of the library workspace. Or you can move all generated programs of a library by moving the Gp node which is available in the file view of the library workspace.

The following restrictions apply:

When you copy, for a example, a program, it is not possible to paste it in the same library. If you want to create a copy, you have to save the object with a new name (see Saving an Object with a New Name). However, it is possible to copy the contents of an entire library to the same system file. In this case, a dialog box appears prompting you to enter a new name for the library (see also Copying and Moving Libraries).

When you copy or move an object to another library in which an object of the type and with the same name exists already, and when you have activated the corresponding workspace option, a dialog box appears asking whether you really want to replace the existing object.

Since cut and copied data is stored on the Windows clipboard, you can also copy or move nodes to the Windows environment (export). Or you can copy or move, for example, an image from the Windows environment to a Natural library node; the image will then be available in a corresponding resource node (import).

Caution:
It is recommended that you copy and move objects only from within Natural Studio. When you copy and move Natural files in the file system (for example, when using the Windows Explorer to move a file from one directory into another directory), the library information in the file FILEDIR.SAG is not updated and the files are therefore not shown in Natural Studio. To update FILEDIR.SAG in such a case, you have to use the FTOUCH utility.

Top of page

Copying Objects

You can copy the selected nodes by using the commands Copy and Paste or by using drag-and-drop.

When you are dragging nodes, the mouse pointer always indicates whether the copied objects can be dropped or not.

Tip:
In a list view window, it is possible to select more than one node.

Start of instruction setTo copy objects using menu commands

  1. Select one or more nodes.

  2. Invoke the context menu and choose Copy.

    Or:
    When the Edit toolbar is shown, choose the following toolbar button.

    Toolbar button

    Or:
    Press CTRL+C.

  3. Select the target node.

  4. Invoke the context menu and choose Paste.

    Or:
    When the Edit toolbar is shown, choose the following toolbar button.

    Toolbar button

    Or:
    Press CTRL+V.

Start of instruction setTo copy objects using drag-and-drop - left mouse button

  1. Select one or more nodes.

  2. Click and hold down the left mouse button.

  3. Drag the mouse to the node to which you want to copy the objects.

  4. Hold down CTRL.

  5. Release the mouse button and then CTRL.

    Caution:
    If you do not hold down CTRL before releasing the mouse button, the objects are moved.

    Note:
    The above description applies when the workspace option Context menu for drag-and-drop with left mouse button is not enabled (default). However, when you enable this option, you need not press CTRL. A context menu will then appear from which you can choose whether to copy or move the objects.

Start of instruction setTo copy objects using drag-and-drop - right mouse button

  1. Select one or more nodes.

  2. Click and hold down the right mouse button.

  3. Drag the mouse to the node to which you want to copy the objects.

  4. Release the mouse button.

  5. From the resulting context menu, choose Copy Here.

Top of page

Moving Objects

You can move the selected nodes by using the commands Cut and Paste or by using drag-and-drop.

When you are dragging nodes, the mouse pointer always indicates whether the cut objects can be dropped or not.

The selected nodes are deleted at their original position and copied to the new position.

Tip:
In a list view window, it is possible to select more than one node.

Start of instruction setTo move objects using menu commands

  1. Select one or more nodes.

  2. Invoke the context menu and choose Cut.

    Or:
    When the Edit toolbar is shown, choose the following toolbar button.

    Toolbar button

    Or:
    Press CTRL+X.

  3. Select the target node.

  4. Invoke the context menu and choose Paste.

    Or:
    When the Edit toolbar is shown, choose the following toolbar button.

    Toolbar button

    Or:
    Press CTRL+V.

Start of instruction setTo move objects using drag-and-drop - left mouse button

  1. Select one or more nodes.

  2. Click and hold down the left mouse button.

  3. Drag the mouse to the node to which you want to move the objects.

  4. Release the mouse button.

    Notes:

    1. When the workspace option Context menu for drag-and-drop with left mouse button is enabled, a context menu will appear from which you can choose whether to copy or move the objects.
    2. When you are working with SPoD and drag an object to a different environment using the left mouse button (for example, from the local environment to a remote UNIX environment, or from a remote UNIX environment to a remote mainframe environment), the object is copied and not moved. The object is not deleted at its original position.

Start of instruction setTo move objects using drag-and-drop - right mouse button

  1. Select one or more nodes.

  2. Click and hold down the right mouse button.

  3. Drag the mouse to the node to which you want to move the objects.

  4. Release the mouse button.

  5. From the resulting context menu, choose Move Here.

Top of page

Exporting Objects

You can export a node from the Natural environment to the Windows Explorer. This is helpful, for example, when you want to send one of your Natural source objects to an other user via e-mail.

To export a node, you use the Copy or Cut command of Natural Studio as described above and the Paste command of the Windows Explorer. You can also use drag-and-drop.

When you drag a node to the Windows environment using the left mouse button, it is always copied (it is not necessary to press CTRL in this case). When you use the right mouse button for drag-and-drop, you can select the appropriate command for copying or moving from a context menu.

When you export a group node (for example the Programs node which is available in the logical view), all sources and generated programs are copied or moved. When both source and generated program are available for an object, two files will then be available in the Windows environment. The extension indicates the type of file. Example: "NSP" stands for Natural source program and "NGP" stands for Natural generated program.

Top of page

Importing Objects

You can import files from the Windows Explorer to the Natural environment. This is helpful, for example, when you have received a Natural source object via e-mail.

To import files, you use the Copy or Cut command of the Windows Explorer and the Paste command of Natural Studio as described above. You can also use drag-and-drop.

When you drag a file to the Natural environment using the left mouse button, the file is always copied (it is not necessary to press CTRL in this case).

When you select a folder name in the Windows Explorer and then import this folder, only the content of the folder is imported. Subfolders are not imported. To import the content of a subfolder, either select the subfolder name or display its contents and select the required objects. When an object is imported which has a file extension unknown to Natural, it is stored as a resource.

Important:
Before the import is started, it is important to set the proper programming mode (structured mode or reporting mode) in which the Natural objects to be imported were developed, otherwise some of them might not be compiled. To set the programming mode, you can either set the compiler option SM as described in Using Session Parameters, or you can enter the system command GLOBALS with the following values in the command line: GLOBALS SM=ON (structured mode) or GLOBALS SM=OFF (reporting mode). See also Natural Programming Modes in the Programming Guide.

Top of page

Renaming Objects

A subroutine cannot be renamed in the logical view. This is because the logical view always shows the subroutine name that has been defined in the program (which may exceed 8 characters). The flat view and file view show the name that has been defined when saving the subroutine; this can be renamed.

Tip:
It is recommended that you rename objects in the logical view. When you rename, for example, a source in the file view for which a generated object exists, only the source is renamed; a new generated program with the new name is not created. The existing generated program is not renamed.

Note:
You can also rename an object by entering the system command RENAME in the command line. In this case, a dialog box appears in which it is also possible to change the type.

See also Renaming Libraries.

Start of instruction setTo rename an object

  1. Select the node that is to be renamed.

    Note:
    Only one object can be renamed at a time. If several objects are selected in a list view window, the Rename command is only applied to the object which has the focus.

  2. From the Object menu, choose Rename.

    Or:
    Invoke the context menu and choose Rename.

    Or:
    Press F2.

    The name is selected so that you can immediately enter a new name. Any text you enter automatically deletes the selection.

    Note:
    If you want to cancel your modifications, press ESC.

  3. Enter a new name for the object.

    See also Object Naming Conventions.

    Note:
    When the name is in edit mode, you can invoke a context menu. In addition to the standard Windows editing commands such as Cut and Paste, the context menu may also contain Windows commands for Unicode. See your Windows documentation for further information.

  4. Press ENTER.

    Or:
    Click any other position in the library workspace or list view window.

    When a filter is currently active, it may happen that the renamed object is not shown since its name now starts with different characters. See Filtering Libraries and Objects for further information.

Top of page

Changing the Type of a Natural Object

You can change the type of any object except a DDM, map, or dialog. For the remaining objects, the following restrictions apply:

Note:
You can also change the object type by entering the system command RENAME in the command line. In this case, a dialog box appears in which it is also possible to rename the object.

Start of instruction setTo change the object type

  1. Open the object so that it is shown in an editor window. See Opening an Existing Natural Object.

  2. Make sure that the editor window is the active window.

  3. From the Object menu, choose Object Type > object-type.

    Only the allowed object types are available from the menu.

    The new type is indicated in the title bar of the editor window.

  4. Save the object to make the conversion complete.

Top of page

Changing the Code Page of a Natural Object

The code page is defined in the properties of an object. If available for the selected object type, you can invoke an Encoding dialog box from the Properties dialog box. See Properties for the Nodes for further information.

Changing the code page of an object means that the encoding information which is stored in the file FILEDIR.SAG is changed; it does not mean that the contents of the object is converted in any way. If you want to convert an object to a different code page, you have to open the object and save it with the Save As command; you can then select the desired encoding in the Save As dialog box (see Saving an Object with a New Name).

For further information on code pages, see the Unicode and Code Page Support documentation.

Top of page

Deleting Objects

When you delete an object in the logical view or flat view, both source and generated program are deleted.

You can delete, for example, all programs in a library by deleting the Programs node in the logical view. Or you can delete only the generated programs in a library by deleting the Gp node in the file view.

It is not possible to delete an object when the editor window for this object is currently open.

See also Deleting Libraries.

Note:
You can also delete objects by entering the system command SCRATCH, PURGE or UNCATALOG in the command line. A dialog box appears for each of these system commands and you can select the objects to be deleted.

Start of instruction setTo delete objects

  1. Select one or more nodes.

    Tip:
    In a list view window, it is possible to select more than one node.

  2. From the Object menu, choose Delete.

    Or:
    Invoke the context menu and choose Delete.

    Or:
    Press DEL.

    When the corresponding workspace option has been set, you are prompted to confirm the deletion.

Top of page

Printing Objects and Views

There are two different types of print command. You can either print an object or the content of a view. The object or view is printed on a printer that is defined in Windows.

The layout of the printed page is defined in the Options dialog box. See Printing Options for further information.

The following topics are covered below:

Printing Objects

When you print an object, its source code is printed. In the case of an object which has a graphical representation (such as a dialog or map), the source code as generated by Natural is printed.

If the source is partially collapsed in the program editor (see Showing and Hiding Source Code in the Program Editor section of the Editors documentation), the hidden lines are not printed.

Note:
The description below does not apply to resources. See Managing Resources.

Start of instruction setTo print objects

  1. Activate the editor containing the object that you want to print.

    Or:
    Select the object in the library workspace or application workspace.

    Or:
    Select one or more objects in a list view window.

  2. From the Object menu, choose Print.

    Or:
    Invoke the context menu and choose Print (not possible in the editor window).

    Or:
    When the Object toolbar is shown, choose the following toolbar button.

    Toolbar button

    Or:
    Press CTRL+P.

    The Print dialog box appears.

  3. Specify all required information (for example, a different printer or text orientation) and choose the Print button.

Printing Views

You can print the contents of tree view windows and list view windows.

Start of instruction setTo print a tree view or list view

  1. Activate the window for which you want to print a view (either a tree view window or a list view window).

  2. Optional. Select a node if the printout is to contain the output described above.

  3. From the View menu, choose Print View.

    In a tree view window, it is also possible to choose command from the context menu, but only when a node is not selected.

    The Print dialog box appears.

  4. Specify all required information (for example, a different printer or text orientation) and choose the Print button.

Top of page

Refreshing the Display

Usually when something changes in Natural Studio, the display is automatically refreshed. This happens, for example, when objects are created, renamed or deleted. This automatic refresh requires that the corresponding option has been set in the workspace options.

There are, however, situations where an automatic refresh does not take place, since Natural is not aware of a modification. For example, two Natural processes are currently active and both are working on the same system file. When one Natural is applying a change to the system file (such as creating a new object), the second Natural is not aware of this modification. In this case, you have to refresh the display manually.

A manual refresh can only be performed on a selected system file node or library node (in the library workspace, application workspace or in a list view window). It can be performed in both the local and remote environment.

Start of instruction setTo refresh the display manually

  1. Select the system file node or library node to be refreshed.

  2. From the View menu, choose Refresh.

    Or:
    From the context menu, choose Refresh.

    Or:
    Press F5.

Top of page