Version 6.3.13 for Windows
 —  Programming Guide  —

How To Edit a Dialog's Enhanced Source Code

This document covers the following topics:


What Is The Enhanced Source Code Format?

The enhanced source code format enables you to edit source code that has been generated by the dialog editor. You edit enhanced source code in a program editor window. When you edit a dialog, the dialog editor stores the results in internal structures. From these structures, source code is generated when you save, stow, list or execute any other system command on the dialog. Code is also generated when you refresh the program editor's source code window.

You can edit enhanced source code as you do any other Natural user code. The source code syntax is subject to a number of formal conventions, however. For a documentation of the enhanced source code syntax, see Enhanced Source Code Format in the Dialog Editor part of the Editors documentation.

When you execute a system command on a dialog you have just edited in the program editor source code window, the dialog editor updates its internal structures and refreshes the source code window.

Note:
The dialog editor preserves code layout only in the user code sections, such as event handlers.

The dialog editor supports the following source formats:

The characteristics of the enhanced source code format are:

For dialogs in the old formats, this means:

Top of page

Avoiding Incompatibilities Between Dialog Editor And Program Editor

When you edit the enhanced source code format, note that some of the syntax elements accepted by the program editor are not accepted by the dialog editor. Enhanced source code editing is not intended as a new programming technique in addition to using the dialog editor:

In the sections that are not user code, you should avoid such incompatibilities by adding only code that is acceptable to both the compiler and the dialog editor.

In the user code sections, such as in event-handler sections and in external or internal subroutines, your choice of programming techniques is not restricted by the dialog editor. In these sections, however, you have no visual editing support.

As a general rule, a mixed approach is often the best, especially when you use dialog-editor- generated code as a starting point.

Note:
In the dialog editor, you can copy dialog elements to the clipboard and when you paste them into user code, they appear as text.

Top of page

How To Use The Enhanced Source Code Format

Start of instruction setTo edit a dialog in the enhanced source code format

  1. Load the dialog into the dialog editor.

  2. From the Dialog menu, choose Source Code.

    Or:
    Choose the "Source Code" toolbar button.

    Or:
    Press CTRL+ALT+C.

    The dialog's source code window appears and the program editor is loaded. This editor enables you to scan for text strings, replace them, and so on. For more information on how to use the program editor, refer to Program Editor.

The enhanced source code format's syntactical conventions are documented in the section Enhanced Source Code Format of the Dialog Editor part of the Editors documentation.

Enhanced source code can be listed and printed as usual. You can also scan for strings by using the Find command of the Edit menu.

Note:
If you are replacing strings with this command, this can make a dialog source incompatible with the dialog editor.

Top of page