1. EXWC not quitting when prog quits
- Posted by AndyDrummond Aug 01, 2008
- 924 views
I have a weird one here. I'm running on Windows XP, and I am running a Euphoria program as a CGI app from a web page. The program runs OK and returns good html, and terminates. But the exwc.exe interpreter still continues - so the server sits and waits for it to end and times out. The Eu program copies what it sends to stdout to a file, and logs the fact that it is about to end, all quite OK. And the program does end. But task manager (set to high speed updating) shows exwc.exe as still executing. Durr! I can't get my head around how this can happen, or how to ensure exwc dies off once the *.exw program has terminated. If anyone has any ideas I will be glad to know them, even if I do a Homer and hit myself and go Doh!
2. Re: EXWC not quitting when prog quits
- Posted by ghaberek (admin) Aug 01, 2008
- 889 views
Are you testing your code on the command line manually with exwc? Perhaps it's leaving a "Press Enter..." prompt, waiting for something to happen.
Here's a couple things every Euphoria CGI program should have:
without warning
This will prevent the interpreter from reporting unused variables.
flush(1) abort(0)
The Interpreter will hit this, forcibly flush its console output and exit immediately.
-Greg
3. Re: EXWC not quitting when prog quits
- Posted by CoJaBo Aug 01, 2008
- 926 views
When Ctrl+C is pressed it doesn't exit either, just displays "Press Enter..." and keeps running.
Pressing enter terminates the program, but if the program does wait_key(), that gets the enter instead, and theres no way to exit without resorting to Task Manager.
4. Re: EXWC not quitting when prog quits
- Posted by AndyDrummond Aug 01, 2008
- 873 views
I thought the same thing. At the very very end of the prog it writes "End" to a little debug file just to show that it got there. Does that. I even used time() to timestamp these messages, and the program runs to completion in 0.2secs. There is nothing after that last line (by definition, I suppose). I added abort(0) and still the same. So no, I don't think it is waiting for a Press any key.." prompt. Any other thoughts?
5. Re: EXWC not quitting when prog quits
- Posted by CoJaBo Aug 01, 2008
- 887 views
I thought the same thing. At the very very end of the prog it writes "End" to a little debug file just to show that it got there. Does that. I even used time() to timestamp these messages, and the program runs to completion in 0.2secs. There is nothing after that last line (by definition, I suppose). I added abort(0) and still the same. So no, I don't think it is waiting for a Press any key.." prompt. Any other thoughts?
Did you try adding "without warning"?
Also try running it directly, without CGI so you can see if anything odd happens.
6. Re: EXWC not quitting when prog quits
- Posted by AndyDrummond Aug 01, 2008
- 894 views
Arghh! Or was it Doh without warning, I was warned to include that. I forgot. Now exwc quits as expected and I merely have to go and undo all the damage I have done in the last few hours because of a warning. I wonder if warnings could be dumped into a file?
Thanks a lot - what would I do without you guys pointing out the obvious??
7. Re: EXWC not quitting when prog quits
- Posted by DerekParnell (admin) Aug 01, 2008
- 880 views
I wonder if warnings could be dumped into a file?
Version 4 has a new warning_file() statement that causes warnings to be directed to a file.
8. Re: EXWC not quitting when prog quits
- Posted by DerekParnell (admin) Aug 01, 2008
- 875 views
Version 4 also has a -BATCH command line option that is designed for programs running in an automated environment. It causes any "Press Enter" type prompt due to error, to be suppressed.
9. Re: EXWC not quitting when prog quits
- Posted by DerekParnell (admin) Aug 01, 2008
- 887 views
And I forgot, it also has as -WF command line option that specifies the file that will capture warning messages, instead of having them go to the console.
exwc -WF captured.txt -BATCH myapp.exwIn addition, you now have finer control about which warnings to report on.
10. Re: EXWC not quitting when prog quits
- Posted by CoJaBo Aug 01, 2008
- 918 views
Version 4 also has a -BATCH command line option that is designed for programs running in an automated environment. It causes any "Press Enter" type prompt due to error, to be suppressed.
On the latest build for Windows (973), -BATCH only suppresses "press enter" for syntax errors, not runtime errors.
Has this been fixed yet, and if not, will it be fixed?
11. Re: EXWC not quitting when prog quits
- Posted by DerekParnell (admin) Aug 01, 2008
- 918 views
- Last edited Aug 02, 2008
On the latest build for Windows (973), -BATCH only suppresses "press enter" for syntax errors, not runtime errors.
Has this been fixed yet, and if not, will it be fixed?
I thought it was ok. Can you write the smallest program that exhibits the behaviour that you want corrected? Also, exactly what are you expecting instead of what it is currently doing?
12. Re: EXWC not quitting when prog quits
- Posted by DerekParnell (admin) Aug 01, 2008
- 875 views
- Last edited Aug 02, 2008
I thought it was ok. Can you write the smallest program ...
Nevermind. I found the problem. I'll see what can be done.
13. Re: EXWC not quitting when prog quits
- Posted by CChris Aug 04, 2008
- 903 views
Arghh! Or was it Doh without warning, I was warned to include that. I forgot. Now exwc quits as expected and I merely have to go and undo all the damage I have done in the last few hours because of a warning. I wonder if warnings could be dumped into a file?
Thanks a lot - what would I do without you guys pointing out the obvious??
Eu4.0 has a warning_file(file_name) for exactly this purpose. There is also a nuke'em all warning_file(-1) to suppress any kind of warning generation or output.
CChris
14. Re: EXWC not quitting when prog quits
- Posted by AndyDrummond Aug 04, 2008
- 866 views
These wonderful advances in Eu 4 sound very exciting. I suspect I will hold off using it until it reaches a pukka issue (I suppose the successor to a beta release is the gamma release?). Then I can play with them - if I get time. CChris, you seem to have put in a lot, so thank you!
15. Re: EXWC not quitting when prog quits
- Posted by jeremy (admin) Aug 04, 2008
- 875 views
On the latest build for Windows (973), -BATCH only suppresses "press enter" for syntax errors, not runtime errors.
Has this been fixed yet, and if not, will it be fixed?
In the latest SVN, -BATCH now suppresses "press enter" prompts for parse and runtime errors/warnings.
Jeremy