In the Gui4Cli source this part reacts to a change in console output specification
(con:0/0/.. etc)
done with the Gui4Cli interpreter command
Set output
case OUTPUT : Printf("Set Output %s %s",param, val); if (DEFcpOPEN) Close (DEFcp); DEFcp = ZERO; //OS4 was NULL, Global variable DEFcpOPEN = 0; if ((DEFcp = Open (val, MODE_OLDFILE))) { Printf("Set Output %s opened",val); SelectOutput (DEFcp); DEFcpOPEN = 1; /// global variable too stccpy (Defconsolespec, val, 125); } else Printf ("*ERR: Invalid Console spec:\n->%s", val); // we do see this break;
The Gui4Cli user doc doc only considers respecification of the console.
However ( i don't have a printer connected)
set OUTPUT PRT: works if the printer preference is set to using printtofile.device.
Only problem there i can't get rid of an initial requester asking to define the output file.
I tried to use
set output RAM:output
but got the erroor message above, i don't understand why
MODE_OLDFILE opens the file for reading. If it does not exist, Open() fails. Using a file opened for reading with SelectOutput() seems stupid to me.
Thanks Thomas,
failing to see the obvious.
Since i could change to a new CON: or even to PRT: i did not suspect the MODE_OLDFILE
I still wonder why the author chose it.
with MODE_NEWFILE the program works as expected.
IIRC MODE_OLDFILE was used for CON: window specifications in the 1.3 days. So it might have been the standard thing to do. But I might need to check that.