manipulate output with SelectOutput()

4 posts / 0 new
Last post
JosDuchIt's picture
Last seen: 7 years 2 weeks ago
Joined: 2012-01-08 20:57
manipulate output with SelectOutput()

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

  1. case OUTPUT :
  2. Printf("Set Output %s %s",param, val);
  3. if (DEFcpOPEN) Close (DEFcp);
  4. DEFcp = ZERO; //OS4 was NULL, Global variable
  5. DEFcpOPEN = 0;
  6. if ((DEFcp = Open (val, MODE_OLDFILE)))
  7. {
  8. Printf("Set Output %s opened",val);
  9. SelectOutput (DEFcp);
  10. DEFcpOPEN = 1; /// global variable too
  11. stccpy (Defconsolespec, val, 125);
  12. }
  13. else Printf ("*ERR: Invalid Console spec:\n->%s", val); // we do see this
  14. 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

thomas's picture
Last seen: 1 week 5 days ago
Joined: 2011-05-16 14:23
MODE_OLDFILE opens the file

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.

JosDuchIt's picture
Last seen: 7 years 2 weeks ago
Joined: 2012-01-08 20:57
Thanks Thomas, failing to

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.

hypex's picture
Last seen: 38 min 58 sec ago
Joined: 2011-09-09 16:20

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.

Log in or register to post comments