General information
Category:
Coding, syntax & commands
Hi !
Sorry! It is by mistake I've mentioned the SYS(2017) in place of SYS(2007).
I'm using SYS(2007) for getting the checksum value of the records. Pls check the below mentioned function. In this function, I'm storing the data of all the fields in a variable and then generating a checksum value with the help of SYS(2007).
My question is ;
Is this possible to retrieve the fields data from the checksum value.
* ----------------------- *
FUNCTION CheckSum
* ----------------------- *
nFldcount = AFIELDS(aFldArray) && Creating an array and storing the field names
mFld = ''
FOR nCnt = 1 to nFldcount
IF ALLT(UPPE(aFldArray(ncnt,1))) # "CHKSUM"
IF nCnt = 1
mFld = 'STR('+ALLTRIM(UPPER(aFldArray(nCnt,1)))+')'
LOOP
ENDIF
DO CASE
CASE aFldArray(nCnt,2) = 'T' OR aFldArray(ncnt,2) = 'D'
mFld = mFld + '+DTOS(' + ALLTRIM(UPPER(aFldArray(nCnt,1))) +')'
CASE aFldArray(nCnt,2) = 'N' OR aFldArray(nCnt,2) = 'I'
mFld = mFld + '+STR(' +ALLTRIM(UPPER(aFldArray(nCnt,1))) +')'
CASE aFldArray(nCnt,2) = 'L'
mFld = mFld + '+' +IIF(&aFldArray(nCnt,1),"'T'","'F'")
OTHERWISE
mFld = mFld + '+' +ALLTRIM(UPPER(aFldArray(nCnt,1)))
ENDCASE
ENDIF
ENDFOR
RETURN (SYS(2007,&mFld))
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only