Get Library Information

GetLibSize

The GetLibSize procedure returns the current size of a library.

The GetLibSize procedure can be used to retrieve the size (in bytes) of a library and a count of the  number of objects contained in the library.

library-size GetLibSize(
  szLibName       10A    Const 
  nLibSize        20I 0  Options(*NOPASS : *OMIT) 
  nObjCount       10I 0  Options(*NOPASS)
)

See also: RtvLibL

Parameters

szLibName
[input Char(10) const]  The name of the library whose information is returned.
 
nLibSize [optional]
[output int(8) ]  An option variable that receives the size of the library (in bytes). This is the same value returned by the procedure and is provided for compatibility with the CALLP operation code.
 
nObjCount [optional]
[output int(4) ]  An option variable that receives the count of the number of objects in the library.

Return Value

If the function succeeds, the size of the library, in bytes, is returned. The size is a sum of the size for all objects stored in the library and the size of library itself.

Remarks

The return value should be a numeric variable that can hold at least 10 digits. The return value is defined as a 20i0 value (8-byte integer).

Please note: When the information for a large library is retrieved, depending on the CPU and overall system performance, this procedure can take several seconds to several minutes to calculate the library size.

Example

 

The following example retrieves the library size, in bytes, for all the objects in the QGPL library and the QGPL library object itself.

 
      /INCLUDE QCPYSRC,objects
 
.....DName+++++++++++EUDSFrom+++To+++++TDc.Functions+++++++++
     D nLibSize        S             20I 0 
 
     C                   Eval      nLibSize = GetLibSize('QGPL')