Calculates a CRC32 checksum for a file.
varCRC = CRCControlObject.CRC32File(Filename, HexYN, XOrIt, [MaxChunkSize], [StartAt], [EndAt], [FileNum])The CRC32File Method has the following parts:
Part Description Filename Required. String containing path and filename. HexYN Required. Boolean value. True if the CRC should be returned as a Hex string, False if it should be returned as a Long integer. XOrIt Required. Boolean value. True if the CRC should be complemented. Generally, you should probably set this to True. MaxChunkSize Optional. Double (8 byte) integer. Specifies the maximum number of bytes to read from the file in each chunk. If this argument is missing, the CRC toolkit calculates a MaxChunkSize value based on the value of the RAMPercentToUse Property. Argument value must be 0 (the default value, meaning argument is to be ignored) or >= 1024. For obvious reasons (VB file operations and the number of elements in an array both being limited to Long values), a value of > 2147483647 is invalid. A value of > 2147483647 will be silently reduced to 2147483647 without the raising of an error.
This argument has no affect on the actual CRC calculated, it is concerned only with the efficient use of system memory.
StartAt Optional. Long integer. Specifies the byte position at which to start the file read, if a CRC is to be calculated for only part of the file. Default value is 1, i.e. start at the beginning of the file. If the StartAt argument is supplied it must be >=1 and <= than the value of EndAt, unless EndAt has the special value of -1. EndAt Optional. Long integer. Specifies the byte position at which to end the file read, if a CRC is to be calculated for only part of the file. Default value is -1, which has a special meaning of 'end of file'. If the EndAt argument is supplied it must be -1, or (>=1 and >= than the value of StartAt). FileNum Optional. Long integer. If the target file has already been opened by your application for binary access, you may pass the VB file handle. If this argument is missing, the method will open the file and close it before exiting. Value must be in the range 0 to 511, where 0 (the default) means you are not passing a file handle.
The free version of the library does not support chunks. Attempting to read a file larger than MaxChunkSize (whether the argument is supplied by your application or calculated by the library) will result in an error of the type ErrTooLargeForOneChunk. This can be overcome by increasing the size of MaxChunkSize, parsing only smaller files, or by upgrading to the registered version.Most tasks require calling CRC32File with a Filename, HexYN = True, XOrIt = True, and no other arguments.