Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>diskcheck()</b> http://www.X-Hacker.org [<<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()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson