Hi, Vincent
First of all thank you for your reply!
Here is my C# code, I want to write the warning message to the "Log_WarningMessage.txt" file (Fig. 1), but it still write on the console (Fig. 2).
Is there any wrong in my code?
------------------------------
Wu Jason
------------------------------
Original Message:
Sent: Fri January 13, 2023 03:32 AM
From: Vincent Beraudier
Subject: Is there any way to write error & warning message in Opl into text file?
If I don't mistake, you will have to use the OPL api (C++, java or .NET) and will use the IloOplErrorHandler (see https://www.ibm.com/docs/en/icos/22.1.1?topic=c-ilooplerrorhandler or https://www.ibm.com/docs/en/icos/22.1.1?topic=classes-ilooplerrorhandler): The default implementation will write messages to cout
or an alternate stream given to the constructor.
You can look in the OPL examples, such as OplRunSample for a simple implementation of the equivalent of oplrun.
------------------------------
Vincent Beraudier
Original Message:
Sent: Fri January 13, 2023 02:45 AM
From: Wu Jason
Subject: Is there any way to write error & warning message in Opl into text file?
The question is as title asks.
Is there any way to write error & warning message in Opl into text file?
I need to store the information from "Problem Tab" in the Opl for each running case.
Regards, Yen Ting
------------------------------
Wu Jason
------------------------------