Editing and Previewing BMS Files

Enterprise Developer comes with the following functionality for editing BMS files:

BMS text editor inside Eclipse

To edit a BMS file inside Eclipse:

  1. Right-click a .bms file in your project in Application Explorer, and click Open With > BMS Text Editor.

    This opens the BMS text editor in the middle pane.



    The BMS code area is between columns 1 and 71. The name of the BMS screen occupies the first seven characters (columns one to seven). This is followed by a space and the macro name starting in column nine, and then the macro attributes starting in column 16. Longer lines are shown on the next line and a continuation character, X, appears in column 72. Any text beyond column 72 is treated as a comment.

Error reporting

Eclipse provides an initial syntax checking and error reporting on background parse inside the text editor. Syntax checking is limited and only shows some of the errors. You need to compile the BMS source for the compiler to process and display all errors.

If syntax checking find an error in the code, Eclipse displays an error or a warning icon in the left-hand side of the editor on the line where the problem occurred. Hover the icon to view the exact error message.

Preview BMS screens

To preview the BMS screens in Eclipse:

  1. Open a BMS file in the editor, and click (Toggle the BMS previewer view) in the Eclipse toolbar.

    This starts the BMS Preview view with the screen you are editing:



  2. Position the cursor on different sections inside the BMS text editor and note how the related fields in the BMS Preview view are highlighted.

Configuring the BMS Preview view

  1. Click Window > Preferences > Micro Focus > BMS > Preview.
  2. Enable Show indicators for field attributes.
  3. Click Apply and Close.

    With this option, the BMS Preview view displays an indicator in front of the fields in the BMS screen.

Smart Edit Mode

To enable Smart Edit Mode:

  1. Click Window > Preferences > Micro Focus > BMS > Editor.
  2. Ensure Smart edit mode is enabled.

Alternatively:

  • Click Toggle Smart Edit Mode for BMS editor, Toggle Smart Edit Mode, in the Eclipse toolbar to turn the mode on or off.

With Smart Edit Mode enabled:

  • Typing in the left margin and in the middle code area does not move the text in the right hand column.
  • Pressing Tab moves the cursor to the next margin and backfills the line with spaces.
  • When typing in the attribute code area, if you end the line with a comma and press Enter, this adds a continuation marker (X) in column 72 and the cursor moves down a line to the beginning of the attribute area.

    In the same scenario, if you do not end the line with a comma and you press Enter, this creates a new line and moves the cursor to the beginning of it.

Smart Tabs

To enable the Smart Tabs:

  • Enable the Enable smart tabs checkbox in the BMS > Editor preference page.

Alternatively:

  • Click Toggle smart tab for BMS editors, , in the Eclipse toolbar to turn the mode on or off.

With Smart Tab enabled, pressing Tab in the editor moves the cursor at the start of the main sections in the code area - column 9 for the start of macro names, column 16 for the start of the macro attributes, and column 72, at the end of the code area.

Smart Caret

To enable smart Home/End caret support:

  • Enable the Pressing Home/End moves caret to the beginning/end of the area checkbox in the BMS > Editor preference page.

Alternatively:

  • Click Toggle smart home/end carret support for BMS editors, , in the Eclipse toolbar to turn the mode on or off.

With smart Home/End caret enabled:

  • Pressing Home positions the cursor at the start of the current section in the code area, and then at the start of the preceding section - at columns 8, 16, 72, and 73.
  • Pressing End positions the cursor at the end of the code in the current area, and then at the start of the next area.

Outline and Program Outline views

  1. Open a BMS file in the text editor and check the Outline and Program Outline views.

    The tree structure shows the BMS mapsets, maps and any attributes with their properties as tree nodes:



  2. Hover any of the nodes in the views to see its properties.
  3. Move the cursor between different fields inside the BMS text editor and note how the related fields are selected in the Outline or the Program Outline views.
  4. This works the other way around so, if you click on a node in the Outline or the Program Outline view, this highlights the line for the same field inside the editor.