Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Call the methods and catch the exceptions – PB Docs 2019 – PowerBuilder Library

Call the methods and catch the exceptions – PB Docs 2019

Call the
methods and catch the exceptions

Where you are

Add a new sheet window
to the existing application

Create user-defined
exception objects

Create a new user
function and user event

> Call the methods
and catch the exceptions

Run the
application

You now write code to populate the drop-down list box controls with
state codes from the customer table in the Demo Database database. Since
you made the control editable, an application user can also type in a
value for the state code. Before you process a user-entered value, you
check to make sure the value conforms to the conditions you set in the
ue_modified event, namely that it is two characters in length.

You also add code to the Clicked event of the command button control
to process the current state code in the drop-down list box control. In
the Clicked event you call the uf_percentage function to calculate the
percentage of customers from the selected state and catch all exceptions
that can be thrown by the function.

  1. Make sure the w_cust_pct is open in the Window painter and that
    ddlb_state displays in the first drop-down list box of the Script
    view.

  2. Select losefocus ( ) returns long [pbm_cbnkillfocus] in the
    second drop-down list box.

  3. Call the ue_modified event and catch the exception object that
    it throws by entering the following lines for the losefocus event
    script:

  4. Select constructor ( ) returns long [pbm_constructor] from the
    second drop-down list box in the Script view prototype window for the
    ddlb_state control.

  5. Enter the following lines in the Constructor event to populate
    the drop-down list box control:

  6. Select cb_percent from the first drop-down list in the Script
    view.

    Make sure clicked ( ) returns long [pbm_bnclicked] displays in
    the second drop-down list box.

  7. Enter the following lines for the Clicked event script:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x