1. abort() in translated programs
- Posted by Juergen Luethje <j.lue at gmx.de> Apr 30, 2003
- 573 views
Hello all, my programs often begin like this: -------------------------------------------------------------->8------- include msgbox.e constant CMD = command_line() procedure help() integer void void = message_box("Usage: myprog <infile>", "Info", MB_ICONINFORMATION) abort(1) -- Same effect, whether abort() is placed here ... end procedure if length(CMD) != 3 then help() -- abort(1) -- ... or here. end if -- Here goes the main program ... -------------------------------------------------------------->8------- Using the interpreter (2.3 or 2.4 Beta), this snippet runs as expected. Using the translator (2.3 or 2.4 Beta), and the Borland C++ 5.5 Command-line Compiler, at the end of the program a console window pops up, with one blank line, and "Press Enter..." on the second line. I'm just making my first steps with the translator. What happens here? TIA, and best regards, Juergen -- /"\ ASCII ribbon campain | \ / against HTML in | Money is the root of all evil. X e-mail and news, | Send 20 Dollars for more info. / \ and unneeded MIME |
2. Re: abort() in translated programs
- Posted by Robert Craig <rds at RapidEuphoria.com> Apr 30, 2003
- 519 views
Juergen Luethje wrote: > my programs often begin like this: > > -------------------------------------------------------------->8------- > include msgbox.e > constant CMD = command_line() > > procedure help() > integer void > void = message_box("Usage: myprog <infile>", "Info", MB_ICONINFORMATION) > abort(1) -- Same effect, whether abort() is placed here ... > end procedure > > if length(CMD) != 3 then > help() > -- abort(1) -- ... or here. > end if > > -- Here goes the main program ... > -------------------------------------------------------------->8------- > > Using the interpreter (2.3 or 2.4 Beta), this snippet runs as expected. > Using the translator (2.3 or 2.4 Beta), and the Borland C++ 5.5 > Command-line Compiler, at the end of the program a console window pops > up, with one blank line, and "Press Enter..." on the second line. > > I'm just making my first steps with the translator. What happens here? There may be a slight incompatibility there. What happens if you say: abort(0) instead of abort(1) As I recall, the Translator may have an extra feature where it gives you a prompt when the abort code is non zero, before it closes the window. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
3. abort() in translated programs
- Posted by "Juergen Luethje" <j.lue at gmx.de> Nov 27, 2004
- 535 views
Hello Rob, in the 2.5 alpha version of the translator, there is still that glitch concerning abort(). When the argument to abort() is not 0, translated programs are not compatible with interpreted programs. When the following program: puts(1, "Hello!") abort(1) is interpreted, it terminates immediately, as expected. When translated and compiled, a console window pops up, showing a blank line, and "Press Enter..." on the next line, waiting for the user pressing [Enter], before the window closes. So currently I cannot use arguments other than 0 to abort() like I want in translated programs. I would appreciate it very much, if abort() would work in translated programs the same way as in interpreted programs. Regards, Juergen -- Have you read a good program lately?
4. Re: abort() in translated programs
- Posted by Robert Craig <rds at RapidEuphoria.com> Nov 27, 2004
- 548 views
Juergen Luethje wrote: > in the 2.5 alpha version of the translator, there is still that glitch > concerning abort(). When the argument to abort() is not 0, translated > programs are not compatible with interpreted programs. When the > following program: > puts(1, "Hello!") > abort(1) > is interpreted, it terminates immediately, as expected. > > When translated and compiled, a console window pops up, showing a > blank line, and "Press Enter..." on the next line, waiting for the > user pressing [Enter], before the window closes. > So currently I cannot use arguments other than 0 to abort() like I want > in translated programs. > > I would appreciate it very much, if abort() would work in translated > programs the same way as in interpreted programs. OK. Thanks for reminding me. I'll look into it. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
5. Re: abort() in translated programs
- Posted by "Juergen Luethje" <j.lue at gmx.de> Nov 27, 2004
- 553 views
- Last edited Nov 28, 2004
Robert Craig wrote: > Juergen Luethje wrote: <snip> >> I would appreciate it very much, if abort() would work in translated >> programs the same way as in interpreted programs. > > OK. Thanks for reminding me. I'll look into it. Thanks! Regards, Juergen
6. Re: abort() in translated programs
- Posted by Juergen Luethje <j.lue at gmx.de> May 01, 2003
- 544 views
Hello Rob, you wrote: > Juergen Luethje wrote: [...] >> Using the interpreter (2.3 or 2.4 Beta), this snippet runs as expected. >> Using the translator (2.3 or 2.4 Beta), and the Borland C++ 5.5 >> Command-line Compiler, at the end of the program a console window pops >> up, with one blank line, and "Press Enter..." on the second line. >> >> I'm just making my first steps with the translator. What happens here? > > There may be a slight incompatibility there. > What happens if you say: > abort(0) > instead of > abort(1) Ah, using 'abort(0)' the translated program is compatible with the interpreted program. Thanks. Best regards, Juergen -- /"\ ASCII ribbon campain | \ / against HTML in | Money is the root of all evil. X e-mail and news, | Send 20 Dollars for more info. / \ and unneeded MIME |