The code reproduced above is from much older versions of XBrowse.
XBrowses column object's data nWidth is in pixels. Report class requires data width to be specified in number of characters.
In the recent versions of XBrowse the column object has a new DATA nDataLen and nDataDec ( in addition to the earlier cDataType ).
We can now specify a column with either in pixels by assigning a value to oCol:nWidth or in number of characters by assigning value to oCol:nDataLen.
If we specify oCol:nDataLen ( instead of oCol:nWidth in pixels ), Xbrowse calculates the pixel width for display depending on the font size. In addition, oCol:nDataLen is used to specify the report column width in the Report method.
So, to control the report column widths,
(1) Use picture clause ( Report allocates as much space that is required )
or
(2) Specify oCol:nDataLen instead of oCol:nWidth while defining the xbrowse column.
While defining Xbrowse in command mode, if we specify sizes as negative numbers in COLSIZES clause, they are considered as nDataLen.
Example:
REDEFINE XBROWSE oBrw COLUMNS ..... COLSIZES 80, -12, 100, -15
In this case, 80 and 100 are considered as pixel widths and are assigned to oCol:nWidth and 12 and 15 are considered as widths in number of characters and assigned to oCol:nDataLen
With this feature we can easily control the Report column widths