1. Exiting from a program
- Posted by Tom Dailey <thomasdailey at comcast.net> Jan 05, 2006
- 454 views
- Last edited Jan 06, 2006
I just downloaded and installed Euphoria on my Linux box, and I've written my first program -- a factorial function. In my source file, printfact.exu, I have the function definition, followed by "? factorial (5)". When I enter the shell command "exu printfact.exu", the answer, 120, is printed, but then exu enters an interactive mode, printing out "Press Enter...". I just want it to print the answer and exit (back to the shell). How do I do this? Thanks, Tom Dailey
2. Re: Exiting from a program
- Posted by Alex Chamberlain <alex.chamberlain at tiscali.co.uk> Jan 05, 2006
- 422 views
- Last edited Jan 06, 2006
I don't use Linux and it doesn't happen on a Windows XP machine, but try;
abort(0) -- Returning Successful Completion
Alex
3. Re: Exiting from a program
- Posted by Tom Dailey <thomasdailey at comcast.net> Jan 05, 2006
- 426 views
- Last edited Jan 06, 2006
Thank you for your suggestion. Unfortunately, adding "abort(0)" as the final line of the program has no apparent effect. Tom Dailey
4. Re: Exiting from a program
- Posted by Alex Chamberlain <alex.chamberlain at tiscali.co.uk> Jan 05, 2006
- 412 views
- Last edited Jan 06, 2006
Is it warning you at all? If so, add: }}} <eucode>without warning</eucode> {{{ Otherwise, you may have to wait for a Linux guru to come online! Alex
5. Re: Exiting from a program
- Posted by Tom Dailey <thomasdailey at comcast.net> Jan 05, 2006
- 440 views
- Last edited Jan 06, 2006
Alex: I added "without warning" at the beginning of my source file, but that had no effect. I guess you're right about having to wait for an experienced Linux user... Thanks anyway, Tom
6. Re: Exiting from a program
- Posted by Chris Burch <chriscrylex at aol.com> Jan 05, 2006
- 432 views
- Last edited Jan 06, 2006
Hi Its not a linux thing, I think its just free_console() at the end of the program. Chris http://members.aol.com/chriscrylex/euphoria.htm http://uboard.proboards32.com/ http://members.aol.com/chriscrylex/EUSQLite/eusql.html
7. Re: Exiting from a program
- Posted by Tom Dailey <thomasdailey at comcast.net> Jan 05, 2006
- 436 views
- Last edited Jan 06, 2006
Chris: Yes, free_console() caused the program to exit. Unfortunately, it also erased all traces of my printout. This can't be that hard! I just want to write a program that prints a result on the standard output (my Xterm), and then terminates. In other words, I want to achieve the same effect as if I had executed a C program in which main() executes printf() and then exit(). Surely this is possible. Tom
8. Re: Exiting from a program
- Posted by D. Newhall <derek_newhall at yahoo.com> Jan 06, 2006
- 461 views
Tom Dailey wrote: > > Chris: > > Yes, free_console() caused the program to exit. Unfortunately, > it also erased all traces of my printout. This can't be that > hard! I just want to write a program that prints a result on > the standard output (my Xterm), and then terminates. In > other words, I want to achieve the same effect as if I had > executed a C program in which main() executes printf() and > then exit(). Surely this is possible. Nope. The Linux version of Euphoria uses ncurses to do all writing to the screen so you can't have normal command line programs. The Euphoria Standard Library project : http://esl.sourceforge.net/ The Euphoria Standard Library mailing list : https://lists.sourceforge.net/lists/listinfo/esl-discussion