The vgLib.compareBytes() system function compares the contents of two substrings, byte by byte, without regard for the format of that content.
vgLib.compareBytes() is one of a number of functions maintained for compatibility with code migrated from VisualAge® Generator. New code can use standard EGL operators for these purposes.
EGL performs a byte-to-byte binary comparison of the values. If the values are not the same length, EGL pads the shorter value with blanks, even if that value is numeric.
vgLib.compareBytes(
var1 HEX inOut,
var1index INT in,
var1SubstrLength INT in,
var2 HEX inOut,
var2Index INT in,
var2SubstrLength INT in )
returns (result INT)
The following example shows how to use the vgLib.compareBytes() function.
target, source HEX (6); // index must be multiple of 2
result INT;
target = "123456";
source = "34";
result = vgLib.compareBytes(target,2,1,source,1,1); // result = 0