Using the Maintain Data Editor

In this section:

How to:

Underlying many of the graphical elements of WebFOCUS App Studio Maintain Data is Maintain Data language source code. The Maintain Data Text Editor enables you to create, view, and edit the source code for procedures, procedure components, and other types of files required by your Maintain Data applications. The Maintain Data Text Editor tab opens when you create a new function or edit an existing one. It contains two groups, Find and Position. The Maintain Data Text Editor tab is shown in the following image.

All WebFOCUS App Studio Maintain Data procedures start with the keyword MAINTAIN (which must be in uppercase) and end with the keyword END (also in uppercase), as shown in the following image. When you create a procedure, WebFOCUS App Studio Maintain Data includes these two keywords automatically.

MAINTAIN FILE fannames
$$Declarations
Case Top
Infer fannames.CUSTOMER.SSN into AddFanStack;
Winform Show Form1;
EndCase
Case AddFan
EndCase
END

Note: The text in your window may wrap differently.

FILE fannames tells WebFOCUS App Studio Maintain Data the data sources this procedure is going to access. In the list of components, there is a Data Sources folder with a fannames data source below it.

Data source names (up to 15) follow the MAINTAIN FILE command and are separated by the word AND.

Following this line is a comment line beginning with $$. You can tell that this is a comment since green (the default) is the color for comments. This comment line is automatically generated when you create a procedure.

This particular comment, $$Declarations, is generated automatically by WebFOCUS App Studio Maintain Data when you created the procedure. If you create any new variables using the Request & Data Sources panel, WebFOCUS App Studio Maintain Data places the source code after this comment.

Case Top begins the definition of the Top function. This definition takes up several lines and ends with the keyword EndCase. The first statement, which begins with Infer, defines the AddFanStack data source stack.

The next line of the Top function, Winform Show Form1; is the code that displays Form1 at run time. This code was generated automatically when you created the procedure.

Finally, the Case AddFan and EndCase define an additional function in this procedure.

Finding or Replacing Text Using the Find Group

The Find group contains options that enable you to find or replace text. For information on the Find group options, see the WebFOCUS App Studio Maintain Data Getting Started content.

Reference: Find Dialog Box

You can use the options on the Find dialog box to indicate how to search for information. For information on the Find dialog box options, see the WebFOCUS App Studio Maintain Data Getting Started content.

Reference: Replace Dialog Box

You use the options on the Replace dialog box to indicate how to use the find feature to find and replace information. For information on the Replace dialog box options, see the WebFOCUS App Studio Maintain Data Getting Started content.

Placing the Cursor Using the Position Group

The Position group allows you to place your cursor at the desired line and allows you to turn off line numbers. For information on the Position group options, see the WebFOCUS App Studio Maintain Data Getting Started content.

Using the Shortcut Menu in the Maintain Data Editor

The shortcut menu is available by right-clicking anywhere within the body of the Editor and provides access to the Language Wizard, as well as New Variable, New Function, and New Class dialog boxes.

Note: The New Variable, New Function, and New Class options are also available from the Requests & Data Sources panel by right-clicking your Maintain Data request and selecting them from the shortcut menu.

Language Wizard

Opens the Maintain Language Wizard which helps you build Maintain Data language source code without typing the syntax yourself.

New variable

Opens the New Variable dialog box.

New function

Opens the New Function dialog box.

New class

Opens the New Class dialog box.

Line Numbers

Provides line numbers to the left of the source code.

Outlining

Indents code by one position.

Auto Complete

Not enabled for the Maintain Data Editor.

Auto parse

Parses as you type. Recommendation is to not select this option for Maintain Data.

Parse

Enables you to parse on demand.

Procedure: How to Use the Language Wizard

Maintain Data provides a Language Wizard to help you construct Maintain Data language source code.

  1. Place the cursor where you want your source code to go.
  2. Right-click at the insertion point and select Language Wizard from the shortcut menu.

    The first screen of the Language Wizard opens.

  3. Select the type of code you wish to create and follow the online instructions.

The Language Wizard can generate Maintain Data commands to perform the following tasks:

  • Retrieve records from a data source (NEXT).
  • Update records in a data source (INCLUDE/UPDATE).
  • Operate on a form (Winform).
  • Run another procedure (CALL or EXEC).
  • Operate on a stack (STACK).

Procedure: How to Create a New Variable

  1. In the Requests & Data Sources panel, right-click the procedure name, and from the shortcut menu, select New variable.

    The Maintain Data Editor for the procedure opens and the New Variable dialog box displays.

  2. Type a name for the variable and click OK.

    The new variable is added to the end of the existing variables.

Note: You can also access the New Variable dialog box from within the Maintain Data Editor. Place your cursor where you want the new variable added, right-click, and from the shortcut menu, select New variable.

Procedure: How to Create a New Function

  1. In the Requests & Data Sources panel, right-click the procedure name, and from the shortcut menu, select New function (case).

    The Maintain Data Editor for the procedure opens and the New Function dialog box displays.

  2. Type a name for the function and click OK.

    The new function is added to the end of the existing functions.

Note: You can also access the New Function dialog box from within the Maintain Data Editor. Place your cursor where you want the new function added, right-click, and from the shortcut menu, select New function.

Procedure: How to Edit an Existing Function

In the Requests & Data Sources panel, right-click a function and from the shortcut menu, select Edit or Edit source. The Maintain Data Editor opens, highlighting the code or text of the selected function.

Procedure: How to Create a New Class

  1. In the Requests & Data Sources panel, right-click the procedure name, and from the shortcut menu, select New class.

    The Maintain Data Editor for the procedure opens and the New Class dialog box displays.

  2. Type a name for the class and click OK.

    The new class is added to the end of the existing classes.

Note: You can also access the New Class dialog box from within the Maintain Data Editor. Place your cursor where you want the new class added, right-click, and from the shortcut menu, select New class.