1. John Fauss
  2. PowerBuilder
  3. Tuesday, 26 December 2023 17:22 PM UTC

When I right-click on an object in the System Tree and select "Properties..." from the popup menu, one of the reported properties is: Size in Bytes.

How does PB determine this value? Depending on the object type, the reported value may or may not be close to the total size of the exported source.

For example, if I use the LibraryExport PowerScript function to obtain the exported source syntax of a window, I get a string containing 23,086 (Unicode) characters, or 46,172 bytes. PB reports the object size as 46,398 byte, a difference of roughly 0.5%. That's understandable and acceptable.

When I repeat the exercise for an example DataWindow, the exported source is 40,368 bytes in length, but PB reports its size to be 12,506 bytes, a difference of almost 325%. Not even close. I suspect this discrepancy is largely due to PB's unfortunate propensity for including many DataWindowObject properties in the exported source when their value is the default... or are there other factors at work?

There are also significant size discrepancies with some other types of objects. Why?

Inquiring minds would like to know.

Accepted Answer
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 27 December 2023 05:12 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi John,

 

The Size in Bytes shown in the Properties window refers to the size of the block of memory that the object occupies in the PBL file, which is different from the size of the exported *.srd file.

The size of the exported *.srd file also depends on Encoding, and if you export to ANSI Encoding, the *.srd file will be reduced by half.

 

In addition, in PB 2025, we support the de-PBL solution. Under the new solution, both will calculate the *.srd file size so their values will be the same.

 

Merry Christmas and a Happy New Year!

 

Regards,

Ken

Comment
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.