Release 10.1A: OpenEdge Development:
Progress 4GL Handbook

> ## Displaying the new fields in the window

> You’ve finished with `h-BinCheck.p` and you already made the change to `h-OrderCalcs.p` to run it.

> | To change the window procedure to accept the new `OUTPUT` parameters and display them:

> 1. Add two more fill-in fields to the window and call them cWorstWH and cBestWH.

> 2. Give them labels that describe them, such as These warehouses are unable to fill the order and This is the best US warehouse for the order.

> 3. Go into their property sheets and make them Enabled but Read-Only, like the other fill-in fields. The default data type for fill-ins is `CHARACTER`, so you don’t need to change that.

> 4. Change the `RUN` statement in the `VALUE-CHANGED` trigger to include the two new `OUTPUT` parameters to `h-OrderCalcs.p`, and to display them:

>     DO:
>          RUN h-OrderCalcs.p
>               (INPUT Order.OrderNum,
>               OUTPUT dTotalPrice, OUTPUT dTotalExt,
>               OUTPUT cWorstWH, OUTPUT cBestWH).
>          dAvgDisc =  (dTotalPrice - dTotalExt) / dTotalPrice.
>          DISPLAY dTotalPrice dTotalExt dAvgDisc cWorstWH cBestWH
>               WITH FRAME CustQuery.
>     END.

> 5. Run the window. You see values for the Warehouses that can’t supply the Items for the Order at all and for the Warehouse that is the best source for most of the Items, if there is one:

> The data in the Sports2000 database isn’t too imaginative, so the Cologne Warehouse is almost always unable to supply Items and the Northeast USA Warehouse is almost always the best one. But the values are recalculated every time you select a different Customer or a different Order.

> You’ve learned a great deal in the last two chapters about how to construct complex procedures in the 4GL. Using the principles of block types, data access statements, and record buffer scoping, you can write procedures that express your application’s specialized business logic with a precision and conciseness not possible in any other programming language.

> In the next chapter you go back to having some more fun. You’ll look at some of the other graphical controls Progress supports and how to manipulate them to get the user interface you want.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095