Originally posted by: UDOPS
This code is in the documentation, but when I put it into an empty .mod test file, it generates an error. The other sample for IloOplOutputFile () works fine. What is wrong with the sample?
execute {
var f = new IloOplInputFile();
f.open("output.txt");
if (f.isOpen) {
writeln("f is open");
var s;
while (!f.eof) {
s=f.readline();
writeln(s);
}
f.close();
} else {
writeln("f is closed");
}
if (f.isOpen) writeln("f is open");
else writeln("f is closed");
}
#DecisionOptimization#OPLusingCPLEXOptimizer