Using Events, Functions, and Object-Oriented Programming

    By: Mr. Rik Brooks on Oct 01, 2014

    In this article, Senior Programmer/Analyst, Rik Brooks, explains in detail how to effectively use events and functions following proper object-oriented programming principles.

    Everyone understands events and functions, right? These are such fundamental concepts of Windows programming that there is just no reason to address them, right?

    An event is something that happens. Windows open so we have an Open event. Windows close so we have a Close event. Windows have activate events when they get focus. Of course, windows aren’t the only things that have events, just about every control has a range of events that we can use. Microsoft likes to say that objects ‘consume’ events.

    In general we instinctively know what an event is. We may get a little confused when object orientation is added to the mix. Suppose you create a window called w_grandpa. Now you inherit another window from w_grandpa and name this one w_pa. Then, you inherit a window from w_pa and call it w_son.

    Finally, you put a call to messageBox in the open event of each. In the open event of w_grandpa, display “I am grandpa”. In the open for w_pa display, “I am pa”, and in the open event for w_son display, “I am son”.

    Now if you open w_son, what do you see and in what order?

     

    Login to read the article. Not a member? Create a free account!

    3259
    Released: October 1, 2014, 9:55 am | Updated: November 5, 2014, 6:40 am
    Keywords: PowerBuilder Article | Technical Journal | Development | Object Oriented | PowerBuilder | Rik Brooks


     

     

    TwitterLLinkedinLFacebook

    Copyright © 2014 ISUG-TECH. All Rights Reserved
    All material, files, logos and trademarks within this site are copyright their respective organizations

    Terms of Service - Privacy Policy - Contact the Help Desk