/* This code assumes that the Unique ID will not contain any colons (:). */
DEFINE VARIABLE vToken AS CHARACTER NO-UNDO. DEFINE VARIABLE vUniqueID AS CHARACTER NO-UNDO. /* WebEncode function */ FUNCTION WebEncode RETURNS CHARACTER (pUniqueID AS CHARACTER): RETURN pUniqueID + ":" + ENCODE ("Web" + pUniqueID + "Speed"). END. /* Use this to encode the Unique ID, then pass as parameter */ vToken = WebEncode (vUniqueID). /* Use this to decode the token passed as a parameter. */ vUniqueID = ENTRY (1, vToken, ":"). IF vToken = WebEncode (vUniqueID) THEN /* vToken has not been modified */ ELSE /* ERROR - vToken has been modified */ |