[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 R_DeComp() 
 Decompresses a by R_Compress() compressed file
------------------------------------------------------------------------------

 Syntax
        nRetCode := R_DeComp ( cInFile [, cOutFile] )

 Arguments
        cInFile         File specification of the file to be decompressed
                        (=input file)
                        Format  : [drive:][\path\]filename[.ext]
                        Example : C:\INVOICE\INVOICE.#BF

        cOutFile        File specification of the decompressed file
                        (=output file)
                        Format  : [drive:][\path\]filename[.ext]
                        Example : C:\INVOICE\INVOICE.DBF

                        If NO output file name is specified the output file
                        will be created on the default drive, in the default
                        directory, with the same name as the ORIGINAL file.

                        Example :
                        R_Compress ( 'TEST.DBF', 'TEST.#BF' )
                        R_DeComp   ( 'TEST.#BF' ) => 'TEST.DBF'

 Returns
        nRetCode        Numeric return code

                        The values and descriptions of this return code
                        are defined in RCmpLib.CH :

        +-----------------------------------------------------------+
        |Code|Constant            |Description                      |
        |----+--------------------+---------------------------------|
        |  0 |CP_OKAY             |Everything okay                  |
        |  1 |CP_INVALID_PARM     |Invalid parameter(s) passed      |
        |  2 |CP_OPEN_INPUT       |Error OPENING input file         |
        |  3 |CP_NOT_RCMPLIB      |Not compressed by RCmpLib        |
        |  4 |CP_WRONG_VERSION    |Wrong version of RCmpLib         |
        |  5 |CP_CREATE_OUTPUT    |Error CREATING output file       |
        |  6 |CP_READ_INPUT       |Error READING  input  file       |
        |  7 |CP_WRITE_OUTPUT     |Error WRITING  output file       |
        |  8 |CP_CLOSE_INPUT      |Error CLOSING  input  file       |
        |  9 |CP_CLOSE_OUTPUT     |Error CLOSING  output file       |
        | 10 |CP_MEMORY_ERROR     |Not enough memory                |
        | 11 |CP_ALLOCATE_ERROR   |Error allocating buffer          |
        +-----------------------------------------------------------+

 Description
        Decompresses the input file. The input file should be compressed
        by the R_Compress() function.

        The timestamp of the original (uncompressed) file will be restored
        after the decompression.

        +----------------------------------------------------------------+
        |                         -+- CAUTION -+-                        |
        |                                                                |
        |     IN THE UN-REGISTERED  VERSION OF RCMPLIB THE FOLLOWING     |
        |     REGISTRATION MESSAGE WILL BE DISPLAYED AT RANDOM TIMES     |
        |     (WHILE EXECUTING THE R_DECOMP() FUNCTION) :                |
        |                                                                |
        | UN-Registered version of RCmpLib -+- Please wait for 8 seconds |
        |                                                                |
        |       AFTER A 8 SECONDS DELAY THE PROGRAM WILL CONTINUE.       |
        +----------------------------------------------------------------+

 Example
        *-- Decompressed the file INVOICE.#BF

        *-- Header file of RCmpLib
        #include "RCmpLib.CH"

        LOCAL   nRetCode                        && Return code R_Compress
        LOCAL   aCmpError := CP_ERRMSG          && Array with error msgs

        [...]

        nRetCode := R_DeComp ( 'INVOICE.#BF' )

        IF nRetCode = CP_OKAY

                *-- Decompression okay :
                *--    original (compressed) file can be deleted !

                FErase ( 'INVOICE.#BF' )

        ELSE
                *-- Oops, error while decompressing

                *-- Display the error message
                ALERT ( 'Error R_DeComp() : ' + aCmpError [nRetCode] )
        ENDIF

        && Continuation of the program
        [...]

        More examples can be found in the demo program RCmpDemo.PRG.


See Also: R_Compress() Registratie
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson