|
|
Clarion 6 - General
Started by narainkarthak at 09-19-2008 2:54 AM. Topic has 4 replies.
 
 
|
|
Sort Posts:
|
|
|
|
09-19-2008, 2:54 AM
|
narainkarthak
Joined on 11-27-2007
Kerala,India
Posts 17
|
|
|
|
Hi All,
I am having an application in clarion 6.3.I need to get the function/API for finding out the crc value of a particular file(*.*).This function should return the crc value on passing the entire path of the file.Can anyone help me on this?
Narayanan Kartha K, Analyst Programmer, CCS Technologies(P) Ltd., http://www.ccstechnologies.in
|
|
|
|
|
Report
|
|
|
|
09-19-2008, 8:31 AM
|
Shankar
Joined on 10-24-2005
Dubai, UAE
Posts 219
|
|
|
Hi Narain,
Load the file using the DOS database driver to a CSTRING/STRING variable and calculate the CRC checksum on the variable's contents. The CRC function is an internal function which you can embed into the Global Map as ::
MODULE('CLARION')
nkCRC32 (*STRING Buffer, USHORT Bytes, ULONG Start), ULONG, RAW, NAME('CLA$CRC32')
END
The usage would be ::
CRC_ChkSum = nkCRC32(<StringVar>, SIZE(<StringVar>), 0)
Regards
Shankar
|
|
|
|
|
Report
|
|
|
|
09-19-2008, 11:52 PM
|
Shankar
Joined on 10-24-2005
Dubai, UAE
Posts 219
|
|
|
Hi Narain,
CRC is not a perfect function for checking changes as it can return similar CRC for two files with different contents although the occurence is rare. You maybe use a MD5 Hash which return a 32 byte string value for better results and accuracy. Check www.clariondeveloper.com for examples on using MD5. The MD532.zip will be the better choice as it has a function to work on a file directly. So depending on whether the accuracy needs to be 100%, you decide whether to use CRC or MD5.
In summary, both CRC or MD5 will help you identify changes in file contents.
Regards
Shankar
|
|
|
|
|
Report
|
|
|
|
|
Clarion Communi... » Clarion » Clarion 6 - Gen... » CRC Value
|
|
|
|