Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

3.3.3 Using Supplied Methods and Properties

One of the most powerful features of PowerCOBOL is the use of the many control methods and properties provided. Each control comes with a set of predefined properties and methods.

You may easily make use of properties by moving various values to them, as you did above when changing the background color and font size of the static text control.

To obtain a list of the various properties available for a specific control on your form, you can right-click the mouse on the control name and select the Properties option from the pop-up menu. You can also look these up in the help system.

You may specify property values in this manner prior to application execution. If you want to change a control's property at run-time, as you did above, you need to code an appropriate COBOL Move statement to move a new value to the property.

Make use of the extensive on-line help system to look up property names to determine which values you may move into them, and what COBOL format these values must be in.

While in the Editor window, you may type in the name of a control anywhere in the edit session (or drag the control from the form or project manager into the Editor window to have its name dropped into the edit session).

Once you have the control's name in the Editor, highlight it and right click on it to bring up a pop-up menu. Select Properties to see a list of all of the properties available. Selecting Methods will bring up a list of methods available for this control as well.

Use the on-line help system to answer any questions about available properties or methods. Using the Find tab in the on-line help system and typing in the name of the property or method will quickly take you to the relevant topics.

Using supplied methods will not only enhance your application, but will save you a great deal of development time.

In the printer example above, you can easily enhance the application by adding the SetPrinter method.

Adding a single line of event code such as follows:

	 INVOKE CmPrint1 "SetPrinter" RETURNING ReturnValue

will cause the following Print Setup dialog box to be displayed when executed:

Figure 3.27 The Print Setup dialog box

This allows the user to select print properties and the actual printer he or she wishes to use for the print task.

Another print method available is SetPage, which will bring up the Page Setup dialog box as follows:

Figure 3.28 The Page Setup dialog box

Feel free to explore and experiment with the various supplied methods and properties.

When you are finished experimenting, close the application and go back to the Project Manager window. This completes this chapter.