Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
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))
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement