[clean-list] Termination of console programs under Windows

Norbert Zeh nzeh at cs.dal.ca
Fri Apr 25 23:35:44 MEST 2008


I have a problem I found at least two posts about in the mailing list 
archive, but the questions were never answered satisfactorily.  So let me 
try to be very clear about the issue:

I'm writing a program that outputs stuff to the console but does not 
require console input, ie, a regular command line tool.  The expected 
behavior of such a program is that it does whatever it has to do and 
whenever it is done, it returns to the shell prompt.

Using the four different settings for console interaction in the project 
options, I can get the following behaviors:

1. Display of the regular program output + display of final result of
    computation + wait for input of return key to return to shell prompt.

2. (No return value) Same as 1 without display of final result.

3. (No console) All output is placed into a separate console window which
    closes immediately when the program exits, but nothing appears in the
    console where I actually started the program from the shell.

So none of these options give me the behavior I would expect from a 
command line tool.  The question is:  How can I write a program in CLEAN 
that outputs stuff to the console and then returns me to the shell prompt 
without waiting for me to press Enter?

Note:  I'm running this on Windows (don't know whether this issue exists 
on other OS's) and I'm *not* running it from within the IDE.  I'm invoking 
the final executable from the command line.

Any help would be greatly appreciated.

-Norbert


More information about the clean-list mailing list