简体   繁体   中英

Can `BUFFER-COMPARE` receive fields to compare dynamically?

When trying to dynamically set the USING fields of BUFFER-COMPARE, I get the following error.

WARNING: The USING phrase of the BUFFER-COMPARE statement only honors fields in the source buffer. Ignoring 'cFieldsToCompare'. (5379)

Here is a code sample to clarify, I would like to only compare Field1, Field2, Field4 between buf_target and buf_origin . However, I can't simply write the fields down because they are provided and won't always be the same.

DEFINE VARIABLE cChangedFields      AS CHARACTER  NO-UNDO.
DEFINE VARIABLE cFieldsToCompare    AS CHARACTER  NO-UNDO.

cFieldsToCompare = "Field1,Field2,Field4"

BUFFER-COMPARE buf_target 
USING cFieldsToCompare
TO buf_origin 
SAVE RESULT IN cChangedFields NO-ERROR.

Is there a syntaxe that allow BUFFER-COMPARE to receive fields to compare dynamically?

You can use the BUFFER-COMPARE method of the Buffer handle:

BUFFER buf_target:BUFFER-COMPARE (BUFFER bug_origin:HANDLE, ?, cExceptFields, cFieldsToCompare) . 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM