Is there a way of unifying file syntax errors to a string when consulting?

Writing a C++ program with a PL process as a back-end.
Would like the ability to consult a file and, if there is a syntax error in the PL code, display that error through my C++ exe’s GUI. Is there some way that I can call some consult-equivalent, and actually get hold of the syntax error (if any) in a way I can then make use of?

Yes. Redefine message_hook/3 to call some C++ defined predicate that takes care of the message. Alternatively you can redefine the output streams. An example is in src/pl-ntmain.c, rlc_bind_terminal()

1 Like