|
When you open the Structure Painter from the Power Panel and declare a structure. You are declaring a global structure that you can call directly from any script in the application.
When you declare a structure using the structure item in the Declare Menu, you are declaring a shared structure; the name of the menu item identifies its scope.
|
Painter
|
Scope
|
|
Window Painter
|
Window level
|
|
User Object Painter
|
User-Object level
|
|
Menu Painter
|
Menu level
|
When you declare a structure in the PowerScript Painter, the scope is determined by the painter from which you open the PowerScript Painter and the menu item name identifies the level of the structure.
To call a shared structure from another object in the application, use the dot notation:
objectname.structurename.variable
To declare a structure:
- Select the structure option from the Declare Menu in the painter.
The Select Structure window displays the name of the current structure and a list of structures declared for the current object.
Select Structure window
- Click the New button. The New Structure window displays.
- Enter the name of a variable that you want to include in the structure.
- Enter the data type of the variable in the Data Type box or select a data type from the Data Type drop-down list box. The default for the first variable is integer; the default for subsequent variables is the data type of the previous variable.
TIP: If you are not sure of the data type you want, click the Search button to search for the data type.
- Enter the number of decimal places in the Dec box if the data type is decimal. The default is 2.
Note: The Dec header always displays but the box only displays when the data type is decimal.
- Repeat you until have entered all the variables.
- Click OK to save the structure. The Save As window displays.
- Enter the name of the structure and click the OK button. PowerBuilder saves the structure in the current library and displays the Power Panel.
|