Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Fix #520

Merged
merged 10 commits into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/progress/pct/compile.p
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,31 @@ PROCEDURE initModule:

IF (callbackClass > "") AND NOT bAboveEq113 THEN
MESSAGE "Callbacks are only supported on 11.3+".

/* Callbacks are only supported on 11.3+ */
&IF DECIMAL(SUBSTRING(PROVERSION, 1, INDEX(PROVERSION, '.') + 1)) GE 11.3 &THEN
IF (callbackClass > "") THEN DO:
callback = CAST(Class:GetClass(callbackClass):new(), rssw.pct.ICompileCallback).
IF (callbackClass > "") THEN DO ON ERROR UNDO, LEAVE:
/* First attempt to get the named class, or fail silently. */
DEFINE VARIABLE oClass AS Progress.Lang.Class NO-UNDO.
oClass = Progress.Lang.Class:GetClass(callbackClass) NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
MESSAGE "GetClass Error: " ERROR-STATUS:GET-MESSAGE(1).
ERROR-STATUS:ERROR = false.
END.

/* Confirm the callback implements the expected interface. */
IF VALID-OBJECT(oClass) AND oClass:IsA(get-class(rssw.pct.ICompileCallback)) THEN
callback = CAST(oClass:new(), rssw.pct.ICompileCallback) NO-ERROR.

IF VALID-OBJECT(callback) AND VALID-OBJECT(hSrcProc) THEN
callback:initialize(hSrcProc).

CATCH err AS Progress.Lang.Error:
MESSAGE "Error while creating callback class: " err:GetMessage(1).
END CATCH.
END.
&ENDIF

IF (outputType > "") THEN DO:
IF (LOOKUP("json", outputType) GT 0) THEN DO:
IF bAboveEq117 THEN DO:
Expand Down