Skip to Content

Powerbuilder, missing scripts

Our company is using Powerbuilder 12.5.2 build 5629 on up-to-date Windows 7 machines (HP Elitebooks – few different models). During the last work project, we noticed that scripts 'disappear' from windows inherited from other windows.

We have our own framework, which has a few basic windows. All windows used across our program are inherited from those windows with added functions. This is the structure of windows for the given example:

  • w_basic_window
  • w_singledw_window
  • w_add_user

Below is an example of the problem:

Window for adding new users (w_add_user) was created and it was inherited from a existing basic window (w_singledw_window from w_basic_window). It had a event triggered from 'Add user' button, which adds a new row to the datawindow. This worked fine in a previous project. Now it was needed to add a titlebar to all our window. This was done by editing the basic window (w_basic_window) from which all our windows are inherited. A full rebuild of the worskpace was done and all windows had a titlebar. Then during testing I noticed that the event on 'Add user' was no longer working. I checked the source and our event was missing from the list.

Afterwards, during testing, a few other windows had some events missing (not all). However it is hard to determin all windows with missing events, since our program has 100+ windows.


Did anyone else encounter this problem?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jun 26, 2016 at 02:05 PM

    It sounds like you're defining "missing" based on behaviour at run time. In my experience, this is most often caused by one cause, two variations:

    1. Duplicate objects, and the expected functionality has been coded into the copy of the object that is further down in the library list. Natively, this can be identified by doing a full gen with the warnings option turned on. Using PBL Peeper, Lists / Objects / View / Show / Duplicates. Before deleting any, I always recommend comparing the objects to make sure you have applied changes to both objects that you want to keep. Straight ANSI text compare tools can provide misleading results; PBL Peeper can help you with a proper object compare, but PBDelta does a much more useful job.
    2. Orphaned objects, as I call them, which lead ti hidden duplicates. Orphans are caused when an import fails, the code of the failed import stays in the PBL, but isn't visible by the Library Painter. If there isn't a subsequent successful import to that PBL, most often because the failed import was to the "wrong" PBL, that failed code stays in the first PBL and can be found by the run time engine if it's higher in the Library List. Natively, this can be solved by optimizing each PBL in the Library Painter (or System Tree). PowerGen is a great tool to optimize all your PBLs in one step, but that's like saying a Lamborghini is a great chair; you'll need to look at the rest of its functionality to see the value of the product.
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 26, 2016 at 02:27 PM

    Hi Andrej;

    With my STD Foundation Class framework, I currently work on PB 12.1, 12.5.1 and 12.6 and have never encountered your situation. In fact, since starting to build the initial framework back in 1993, I have never encountered this.

    The framework is a complex set of inherited object classes with various cross object pointers. The frameworks also support Appeon Web & Mobile as well. So when I'm developing, testing PB & Appeon code - I'm compiling & cross compiling the PBL code constantly. Again, with no code less whatsoever.

    I'm wondering if your issue could be related to:

    1) PBL's stored on a network drive instead of local.

    2) PBL's that have not been optimized for a long time.

    3) A problem between PB & your SCN?

    4) your specific build of PB

    5) an issue with a specific PC

    6) duplicate object across PBL's

    Regards ... Chris

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 26, 2016 at 09:55 PM

    Changing ancestor windows in source editor cAn cause this sort of thing.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Andrej Vidmar

      If this is caused by an improper change in Edit Source to an ancestor, there is a good chance that the code is still there but the IDE is unable to show it. Near the top of the source will be a list of added events and function signatures. The code for the events/functions will be further down in the source code. If the event/function signature gets removed, the script could still be there.

  • Posted on Jun 28, 2016 at 07:19 PM

    It looks like you have multiple copies (at least two - one duplicated ) of the ancestor window in different PBLs.

    It seems you have modified the wrong copy (that is in a PBL that appears later in the library list) and so you did not regenerated all descendant with the expected version of the ancestor by doing a full rebuild.

    Use a tool like double object (see PB tools codeplex project) to find duplicates location and remove all the incomplete version you found (keep a copy of them somewhere, we never known). Then do again a full rebuild.

    That way you should recover everything and if not, you known that the Ancestor's pbl is corrupted somehow !

    In that case, optimize the pbl, then redo a full build.

    If it still not work, try to export every objects of this pbl to a newly created one, then replace the old library by the new one in the library list.

    Restart Powerbuilder and do a full build.

    This should work and if not, you will have to found the last backup of the ancestor and start from it to reconstruct anything is missing !

    Hope this will help.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.