1. Jim Reese
  2. PowerBuilder
  3. Monday, 17 July 2023 16:18 PM UTC

Our legacy application has a couple hundred references to backcolor in objects or bitmapbackcolor in menus set to 141454956. This isn't a legitimate RGB value, but I know in the past PB has had special values for special colors. This setting is currently causing the IDE to crash when opening some of the objects with this value set. Has anyone else experienced this issue? Now that I've discovered this, the fix/workaround seems to be fairly easy by editing the source, but wondering why this should be occurring now.

Accepted Answer
Jim Reese Accepted Answer Pending Moderation
  1. Tuesday, 25 July 2023 15:56 PM UTC
  2. PowerBuilder
  3. # Permalink
A colleague of mine who's been here much longer than I tracked it down in the old source code management system I don't have access to, a consultant in 2013 during an application beautification effort accidentally added the '6' at the end of the intended value, probably doing mass source code edits. So it's been like this for almost 10 years in 89 objects, 393 occurrences. Another 677 objects have the correct value. (thanks Roland/PBSearch).
Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 17 July 2023 17:02 PM UTC
  2. PowerBuilder
  3. # 1

Great find and great question! I'd recommend reporting it as a bug on https://www.appeon.com/standardsupport/newbug?check_logged_in=1

regards

Comment
  1. Miguel Leeuwe
  2. Monday, 17 July 2023 17:26 PM UTC
LOL, I don't know, what I do know is that PB is crashing quite a bit more lately. Used to be a lot stabler in PB 2017
  1. Helpful
  1. Roland Smith
  2. Monday, 17 July 2023 17:32 PM UTC
My guess is the number is too large and causing the variable in the C++ code to wrap around to negative which then causes an error calculating the RGB value.
  1. Helpful 2
  1. John Fauss
  2. Monday, 17 July 2023 18:29 PM UTC
The "special" colors that PB has names for (such as "ButtonFace", "WindowBackground" and "Transparent" all have non-zero bits in the high-order byte (above the encoded RGB value) of an unsignedlong color value, resulting in decimal values for these colors in excess of 16,777,215 (0x00FFFFFF), so there is not a restriction per se for a color value being too large.

Most (but not all) of the values of these named colors utilize 0x08 in the high-order byte, and 141454956 is 0x086e6e6c, which does not match any recognized named color, by the way.

My guess is that beginning in PB 2022, color values are now being validated at some point. If this is the case, however, an exception or other run-time error should be thrown instead of crashing the IDE/app.
  1. Helpful 1
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.