The following class compiles successfully:
CLASS Test:
DEFINE TEMP-TABLE ttTest
FIELD id AS INTEGER
FIELD NAME AS CHARACTER.
METHOD PUBLIC VOID TestMethod( BUFFER p-ttTest FOR ttTest ):
UNDO, THROW NEW Progress.Lang.AppError("METHOD NOT IMPLEMENTED").
END METHOD.
END CLASS.
If I try to define an interface for this class I get this error (on the METHOD line).
"Only datasets, temp-tables, and properties may be defined in an interface. (13149)"
INTERFACE SkuUnit.ITest:
DEFINE TEMP-TABLE ttTest
FIELD id AS INTEGER
FIELD NAME AS CHARACTER.
METHOD PUBLIC VOID TestMethod(BUFFER p-ttTest FOR ttTest).
END INTERFACE.
Removing the parameter allows it to compile successfully.
How can I define an interface method that matches this class?
As Peter noted you can use a TABLE parameter (to pass the complete temp-table) or a HANDLE parameter for a buffer. The challenge with using a TABLE parameter is that you will be passing more data than you may want to pass and the challenge with using a HANDLE for a buffer is that the method will need to use dynamic programming to access the information.
The issue you have raised is a limitation with the implementation of interfaces. I have added this issue to the Language team’s backlog.
Please note, that if you did not want to enforce the method signature via an Interface, the existing method syntax does support passing a buffer. This limitation exists with the ABL’s ability to enforce the method signature via interfaces.
As Peter noted you can use a TABLE parameter (to pass the complete temp-table) or a HANDLE parameter for a buffer. The challenge with using a TABLE parameter is that you will be passing more data than you may want to pass and the challenge with using a HANDLE for a buffer is that the method will need to use dynamic programming to access the information.
The issue you have raised is a limitation with the implementation of interfaces. I have added this issue to the Language team’s backlog.
Please note, that if you did not want to enforce the method signature via an Interface, the existing method syntax does support passing a buffer. This limitation exists with the ABL’s ability to enforce the method signature via interfaces.
Dec 2019 and 12.1 gives the same compile error. How is that backlog going?