1. Daniel Vivier
  2. PowerBuilder
  3. Saturday, 22 February 2020 15:59 PM UTC

I'm wondering whether this is a bug, so I'm going to post it here for comment first.

I just found out that you can do the following:

- Working on a project under source control (WizSource)
- Application object not checked out
- Open some other object, and make a change to the Global Variables through that object
- Save: you get prompted twice that "application object is not checked out, OK to save?" or words to that effect, but the change is indeed saved.
- If I do a Show Differences on the application object, the change to the global variables is shown.
- But the application object is still not checked out. 

So obviously at that point, if I do check out the application object, the change will be lost, since a checkout does a Get Latest Version. And also at that point (after the check out), my other object that requires the change to the globals will not compile. 

And finally, if I check in my change to the other object that requires the change to the globals, that won't work for other users, since they don't have my change, since the application object was not checked out and checked in with the change.

I have noticed before that any change to the regular code of a global function object (with no change to the global variables), when the application object isn't checked out, gives those same verification questions, twice, as mentioned above. So I have learned to ignore those questions, since it's obvious that changes to the code of global functions shouldn't be changing the application object (and thus shouldn't be prompting with those questions?).

So is my conclusion that I should only change global variables when the application object is checked out? 

And does this appear to be a bug, that you can override the fact that the application object isn't checked out, when changing global variables from another object?

David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Monday, 24 February 2020 11:51 AM UTC
  2. PowerBuilder
  3. # 1

Hi Dan

I think it is fair to say that this is a bug and has always been one. You should not be able to change the Global Variables unless the Application object is checked out.

All that is needed is for the IDE to stop you changing Global Variables if the aplication is not checked out.

I'm not sure why Chris is going off on one about OO programming techniques when its really a simple problem and I woudl have throught a simple fix. Definately raise a bug, it might get fixed then.

That's my thoughts.

David

Comment
  1. Daniel Vivier
  2. Monday, 24 February 2020 12:18 PM UTC
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 22 February 2020 17:57 PM UTC
  2. PowerBuilder
  3. # 2

Hi Dan;

  PB has always used the Application Object to manage any Global Variables. It's been that way since v1.0. Since PowerSoft updated PB in v3.0 to support SCCAPI based SCM's, developers had "always" had to check out the Application Object to make GV changes. Do nothing new feature or procedural wise. Just keep doing the same with GIT & SVN and no, this is not a bug (but by design).  HTH

Regards .... Chris

 

Comment
  1. Roland Smith
  2. Saturday, 22 February 2020 18:30 PM UTC
The alert when saving a function object is definitely a bug. There's no reason to change the application object when it is saved. Another issue is changing the icon. The icon name is not part of the application source but you have to check it out so you can save.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 24 February 2020 15:09 PM UTC
Hi Roland;

For the GF causing the AO to be checked out .. this issue is already logged in ticket numbers 3327 and 2646. Engineering has been notified.

For the .ICO issue .. I would recommend never changing the name. For example OrderEntry.ico is currently defined and you want to replace it with anew one ... a) OrderEntry.ico to OrderEntry_Old.ico and then b) rename Roland.ico to OrderEntry.ico. Just keep performing the .ICO renaming approach. This would mean that the Application Object would never have to be modified for an ICO change. Food for thought.

Regards ... Chris
  1. Helpful
  1. Andrew Barnes
  2. Monday, 24 February 2020 19:17 PM UTC
It is clearly a bug that you can add a Global Variable which PB stores in the Application object when the application object is not checked out. This would be no different than PB allowing one to save editing changes to any object that is not checked out. On the other hand, in terms of things that really cause PB developers grief and annoyance, this is probably low on the list in that one shouldn't be adding a lot of global variables to an application so this doesn't come up often. And when it does, is quickly discovered and corrected.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Saturday, 22 February 2020 17:48 PM UTC
  2. PowerBuilder
  3. # 3

Definitely submit a bug report.

I don't know if anyone submitted a bug report to Sybase but this has been discussed in the forums.

Comment
  1. Daniel Vivier
  2. Sunday, 23 February 2020 22:22 PM UTC
I really think the right change is either (a) disallow changes to GVs from other objects unless the application object is checked out, or (b) only allow changes to GVs to be made within the application object itself. I don't think there should really be a concept (that Michael Kramer implied) of class-specific GVs. Maybe that was a misunderstanding in my reading of Michael's post.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 24 February 2020 00:40 AM UTC
Hi Dan;

FWIW: technically, PB apps should never have more than one GV and, that should never ever change. That is, if the PB apps are written properly.

The problem around this aspect today is that no one (including Sybase & SAP) taught the BOOA Course (Building Object Oriented Applications) any more. This course developed by the University of Texas really showed developers how to code OO properly with PB.

If you look at my framework, you'll see how to properly use GV's without using GV's. ;-)

Regards ... Chris
  1. Helpful
  1. Ricardo Jasso
  2. Monday, 24 February 2020 15:22 PM UTC
Chris, that's a very good technique. I use it in my applications tough not just one global variable but one per module. Still, the IDE allows you to change the name of that one single global variable even if the application object is not checked out. I think Michael's three point suggestion from his first comment is the way to go.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.