Try OpenEdge Now
skip to main content
Managing ABL Applications
R-code Features and Functions : R-code CRCs and procedure integrity : RCODE-INFO handle : Example: Determining which files differ between application versions
 
Example: Determining which files differ between application versions
The MD5 value is a 128-bit unique key that is stored within a compiled procedure. Changing one character in a procedure file results in a different MD5 value. With the MD5-VALUE attribute for the RCODE-INFO system handle, you can determine which r-code files need to be replaced in your application between versions. The following example code shows the output of the MD5-VALUE attribute:
DEFINE VARIABLE charmd5 AS CHARACTER NO-UNDO.
ASSIGN
  RCODE-INFO:FILE-NAME = "main.r"
  charmd5              = RCODE-INFO:MD5-VALUE.
MESSAGE "MD5 value of main.r: " charmd5.
This code results in the following output:
MD5 value of main.r: E3AD5B5C009B8FA1C20067304161B6CC0D
You could create a program that runs this code for two versions of the same procedure file and then compare the resulting outputs. If they are the same, you know the contents of the procedure file has not changed between the two versions.
If you did not use the GENERATE-MD5 option on the COMPILE statement to compile a procedure, ABL did not store the MD5 value in the r-code file. In this case, this attribute returns the Unknown value (?).