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.
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.
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.
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.
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.
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.
Opens the Maintain Language Wizard which helps you build Maintain Data language source code without typing the syntax yourself.
Opens the New Variable dialog box.
Opens the New Function dialog box.
Opens the New Class dialog box.
Provides line numbers to the left of the source code.
Indents code by one position.
Not enabled for the Maintain Data Editor.
Parses as you type. Recommendation is to not select this option for Maintain Data.
Enables you to parse on demand.
Maintain Data provides a Language Wizard to help you construct Maintain Data language source code.
The first screen of the Language Wizard opens.
The Language Wizard can generate Maintain Data commands to perform the following tasks:
The Maintain Data Editor for the procedure opens and the New Variable dialog box displays.
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.
The Maintain Data Editor for the procedure opens and the New Function dialog box displays.
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.
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.
The Maintain Data Editor for the procedure opens and the New Class dialog box displays.
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.