Archive Method

Adds, extracts, or deletes files from a vsFlexGrid archive file.

Syntax

[form!]VSFlexGrid.Archive ArcFileName As String, FileName As String, Action As ArchiveSettings

Remarks

This method allows you to combine several files into one, optionally compressing the data. This is especially useful for applications that store data in several grids.

To save the grid to a file, use the SaveGrid method. To load the data back from the file, use the LoadGrid method. To obtain information from an archive file, use the ArchiveInfo property.

The parameters for the Archive method are described below:

ArcFileName As String

This parameter contains the name of the archive file, including its path.

FileName As String

This parameter contains the name of the file to be added, deleted, or extracted from the archive.

Action As ArchiveSettings

This parameter specifies the action to perform on the archive. Valid settings are:

 

Constant

Value

Description

arcAdd

0

Adds the file FileName to the archive ArcFileName, compressing it. If the archive file does not exist, it is created. If the file is already present in the archive, it is overwritten with the new contents.

arcStore

1

Adds the file FileName to the archive ArcFileName, without compressing it. If the archive file does not exist, it is created. If the file is already present in the archive, it is overwritten with the new contents.

arcDelete

2

Removes the file FileName from the archive ArcFileName.

arcExtract

3

Creates a copy of the  file FileName on the disk. The file is created on the directory specified in the FileName parameter, or in the archive directory if no path is specified.

 

For example, the code below creates or opens an archive file named "c:\arc.fg", then adds two files to the archive:

    fg.Archive "c:\arc.fg", "c:\autoexec.bat", arcAdd

    fg.Archive "c:\arc.fg", "c:\config.sys", arcAdd

See Also

VSFlexGrid Control