BLOB PROPERTIES

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 6.0


BLOB PROPERTIES (blob; compressed{; expandedSize{; currentSize}})

ParameterTypeDescription
blobBLOBBLOB for which to get information
compressedNumber0 = BLOB is not compressed
1 = BLOB compressed compact
2 = BLOB compressed fast
expandedSizeNumberSize of BLOB (in bytes) when not compressed
currentSizeNumberCurrent size of BLOB (in bytes)

Description

The BLOB PROPERTIES command returns information about the BLOB blob.

The compressed parameter tells whether or not the BLOB is compressed, and returns one of the following values. Note: 4D provides the predefined constants.

Constant   Type   Value

Is not compressed Long Integer 0

Compact compression mode Long Integer 1

Fast compression mode Long Integer 2

Whatever the compression status of the BLOB, the expandedSize parameter returns the size of the BLOB when it is not compressed.

The parameter currentSize returns the current size of the BLOB. If the BLOB is compressed, you will usually obtain currentSize less than expandedSize. If the BLOB is not compressed, you will always obtain currentSize equal to expandedSize.

Examples

1. See examples for the commands COMPRESS BLOB and EXPAND BLOB.

2. After a BLOB has been compressed, the following project method obtains the percentage of space saved by the compression:

      ` Space saved by compression project method
      ` Space saved by compression (Pointer {; Pointer } ) -> Long
      ` Space saved by compression ( -> BLOB {; -> savedBytes } ) -> Percentage

   C_POINTER ($1;$2)
   C_LONGINT ($0;$vlCompressed;$vlExpandedSize;$vlCurrentSize)

   BLOB PROPERTIES ($1->;$vlCompressed;$vlExpandedSize;$vlCurrentSize)
   If ($vlExpandedSize=0)
      $0:=0
      If (Count parameters>=2)
         $2->:=0
      End if 
   Else 
      $0:=100-(($vlCurrentSize/$vlExpandedSize)*100)
      If (Count parameters>=2)
         $2->:=$vlExpandedSize-$vlCurrentSize
      End if 
   End if 

After this method has been added to your application, you can use it this way:

      ` ...
   COMPRESS BLOB (vxBlob)
   $vlPercent:=Space saved by compression  (->vxBlob;->vlBlobSize)
   ALERT ("The compression saved "+String (vlBlobSize)+" bytes, so "+String ($vlPercent;"#0%")+
         " of space.")

See Also

COMPRESS BLOB, EXPAND BLOB.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next