Harry,<br><br>You could run the executable (created with DrRacket from the first code snippet) directly from a Windows Shell command line, and the error will be shown in-line in the command window as expected.<br><br>But, as you state, clicking on the new executable's icon in an Explorer window does show a command window briefly, but the command window disappears before it can be read.<br>
<br>The solution here is to create and use a new Windows Shortcut with a "target" (specified on the "shortcut" tab in the Shortcut's "Properties" window) that runs the executable using the Windows command interpreter (CMD.exe) with the /K option. i.e. Use a Windows Shortcut that explicitly starts a shell that runs the executable, and keeps the shell open after the executable ends, e.g.: The new Shortcut's "target" would be set to something like:<br>
<br>C:\WINDOWS\System32\CMD.exe /K "C:\tmp\file-1.exe" <br><br>Note that with /K, the new (sub-)shell must be terminated explicitly, e.g. by invoking the EXIT command, or by closing the window that displays the shell.<br>
<br>Cheers,<br><br>Kieron.<br><br><div class="gmail_quote">On Fri, Nov 16, 2012 at 2:51 PM, Harry Spier <span dir="ltr"><<a href="mailto:vasishtha.spier@gmail.com" target="_blank">vasishtha.spier@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>1) </div><div>Is there some way to keep the console window open when a racket executable reports an error? (I'm a Windows user)<br>
</div><div><br></div><div>For this example, the racket console window closes before I can read the contract violation message:</div>
<div>#lang racket<br>(provide/contract [amount positive?])<br>(define amount 0)</div><div><br></div><div>This also doesn't stay open for me to read the error message as the contract violation is only displayed after I enter a character to continue.</div>
<div>#lang racket<br>(provide/contract [amount positive?])<br>(define amount 0)</div><div>(system "PAUSE")</div><div><br></div><div>2)</div><div>The reason I was doing this little test was that I thought from the Racket Guide documentation sections 7.1 and 7.1.1 which used this example, that provide/contract only did a contract check when the module was required, and I was checking this both in DrRacket and as an executable.</div>
<div><br></div><div>Thanks,</div><div>Harry Spier</div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br>