[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DISKCHECK()
 Creates a checksum for a disk
------------------------------------------------------------------------------
 Syntax

     DISKCHECK(<cDrive>, [<nStartSector>]) --> nCheckSum

 Arguments

     <cDrive>   Designates which drive (A, B, C, etc.) you want to check.

     <nStartSector>  Designates a sector to serve as a starting point to
     check the disk in the direction of the first sector.

 Returns

     DISKCHECK() returns a number that corresponds to a checksum for the data
     carrier in <cDrive>.  If read errors occur, the function returns a
     negative number when the first bad sector is found.

 Description

     DISKCKECK() begins its check with the last sector of the designated
     drive or with the <nStartSector> value, and works in the direction of
     the first sector.  If a sector is found to contain errors, then it
     returns a negative value.

     If it returns a -1, continue to check for other errors (such as a
     missing disk).  The CA-Clipper Tools function ERRORCODE() is quite
     useful here.  Error code returns a value that symbolizes the most-recent
     DOS error.

     Since DISKCHECK() returns a checksum, it is easy to check for disk
     changes.

 Note

     .  You must specify the <cDrive> parameter.  If you omit it or
        specify an unavailable drive, DISKCHECK() returns an error code of -
        1.  DISKCHECK() takes more time to check a hard disk.

 Examples

     .  Create a checksum for a floppy:

        Checksum  :=  DISKCHECK("A")

     .  Show that the disks are changed:

        IF DISKCHECK("A") == Checksum
           ? "You have not changed disks!"
        ENDIF

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