1. crash_message() problem
- Posted by "Juergen Luethje" <j.lue at gmx.de> Dec 11, 2004
- 474 views
Hi all, when I run this program ...
include machine.e crash_message("An unexpected error has occurred!" & "\nPlease send the file \"ex.err\" to <john_doe at whoops.com>.") function add (atom a, atom b) return a + b end function ? ad(1,2)
... Euphoria prints the following error message on the screen: -=-=-=-=-=-=-=-=-=-=-=-=- C:\Desktop\test.exw:10 ad has not been declared ? ad(1,2) ^ -=-=-=-=-=-=-=-=-=-=-=-=- (tested with exw.exe 2.4 and 2.5 alpha). But it should print my message instead, shouldn't it? Regards, Juergen -- Have you read a good program lately?
2. Re: crash_message() problem
- Posted by Tommy Carlier <tommy.carlier at telenet.be> Dec 11, 2004
- 452 views
Juergen Luethje wrote: > Hi all, > > when I run this program ... > > }}} <eucode> > include machine.e > > crash_message("An unexpected error has occurred!" > & "\nPlease send the file \"ex.err\" to <john_doe at > whoops.com>.") > > function add (atom a, atom b) > return a + b > end function > > ? ad(1,2) > </eucode> {{{ > > ... Euphoria prints the following error message on the screen: > -=-=-=-=-=-=-=-=-=-=-=-=- > C:\Desktop\test.exw:10 > ad has not been declared > ? ad(1,2) > ^ > -=-=-=-=-=-=-=-=-=-=-=-=- > (tested with exw.exe 2.4 and 2.5 alpha). > > But it should print my message instead, shouldn't it? I don't think so: crash_message is used for runtime errors. This is a compile error. -- The Internet combines the excitement of typing with the reliability of anonymous hearsay. tommy online: http://users.telenet.be/tommycarlier tommy.blog: http://tommycarlier.blogspot.com
3. Re: crash_message() problem
- Posted by "Juergen Luethje" <j.lue at gmx.de> Dec 11, 2004
- 438 views
Tommy Carlier wrote: > Juergen Luethje wrote: <snip> >> ... Euphoria prints the following error message on the screen: >> -=-=-=-=-=-=-=-=-=-=-=-=- >> C:\Desktop\test.exw:10 >> ad has not been declared >> ? ad(1,2) >> ^ >> -=-=-=-=-=-=-=-=-=-=-=-=- >> (tested with exw.exe 2.4 and 2.5 alpha). >> >> But it should print my message instead, shouldn't it? > > I don't think so: crash_message is used for runtime errors. > This is a compile error. If crash_message() is used only for runtime errors, then there is an error in the documentation (Eu 2.5 alpha, lib_c_d.htm#crash_message): <quote> Description: Specify a string, s, to be printed on the screen in the event that Euphoria must stop your program due to a compile-time or run-time error. </quote> Regards, Juergen -- Have you read a good program lately?
4. Re: crash_message() problem
- Posted by rudy toews <rltoews at ilos.net> Dec 11, 2004
- 446 views
Juergen Luethje wrote: > > Hi all, > > when I run this program ... > > }}} <eucode> > include machine.e > > crash_message("An unexpected error has occurred!" > & "\nPlease send the file \"ex.err\" to <john_doe at > whoops.com>.") > > function add (atom a, atom b) > return a + b > end function > > ? ad(1,2) > </eucode> {{{ > > ... Euphoria prints the following error message on the screen: > -=-=-=-=-=-=-=-=-=-=-=-=- > C:\Desktop\test.exw:10 > ad has not been declared > ? ad(1,2) > ^ > -=-=-=-=-=-=-=-=-=-=-=-=- > (tested with exw.exe 2.4 and 2.5 alpha). > > But it should print my message instead, shouldn't it? > > Regards, > Juergen > > -- > Have you read a good program lately? > > i ran it with 2.4, dos and windows file types. it printed your crash message as you wanted. i simply cut and pasted your program. what happens when you turn off syntax checking? rudy
5. Re: crash_message() problem
- Posted by Andy Serpa <ac at onehorseshy.com> Dec 11, 2004
- 435 views
rudy toews wrote: > > Juergen Luethje wrote: > > > > Hi all, > > > > when I run this program ... > > > > }}} <eucode> > > include machine.e > > > > crash_message("An unexpected error has occurred!" > > & "\nPlease send the file \"ex.err\" to <john_doe at > > whoops.com>.") > > > > function add (atom a, atom b) > > return a + b > > end function > > > > ? ad(1,2) > > </eucode> {{{ > > > > ... Euphoria prints the following error message on the screen: > > -=-=-=-=-=-=-=-=-=-=-=-=- > > C:\Desktop\test.exw:10 > > ad has not been declared > > ? ad(1,2) > > ^ > > -=-=-=-=-=-=-=-=-=-=-=-=- > > (tested with exw.exe 2.4 and 2.5 alpha). > > > > But it should print my message instead, shouldn't it? > > > > Regards, > > Juergen > > > > -- > > Have you read a good program lately? > > > > > i ran it with 2.4, dos and windows file types. it printed your crash message > as you > wanted. i simply cut and pasted your program. > > what happens when you turn off syntax checking? > Maybe in 2.5 it only works with run-time errors, where this is a parser/compile-time error. That would seem to be more correct behavior anyway (the 2.5 way)...
6. Re: crash_message() problem
- Posted by Robert Craig <rds at RapidEuphoria.com> Dec 11, 2004
- 478 views
Juergen Luethje wrote: > If crash_message() is used only for runtime errors, then there is an > error in the documentation (Eu 2.5 alpha, lib_c_d.htm#crash_message): > > <quote> > Description: Specify a string, s, to be printed on the screen in the > event that Euphoria must stop your program due to a compile-time or > run-time error. > </quote> Thanks. I'll fix the docs. In 2.5, crash_message() can only be executed *after* the syntax and symbols have already been checked. So it's not going to be useful for compile-time errors, only run-time. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
7. Re: crash_message() problem
- Posted by "Juergen Luethje" <j.lue at gmx.de> Dec 11, 2004
- 457 views
Andy Serpa wrote: > rudy toews wrote: >> >> Juergen Luethje wrote: >>> >>> Hi all, >>> >>> when I run this program ... >>> >>> }}} <eucode> >>> include machine.e >>> >>> crash_message("An unexpected error has occurred!" >>> & "\nPlease send the file \"ex.err\" to <john_doe at >>> whoops.com>.") >>> >>> function add (atom a, atom b) >>> return a + b >>> end function >>> >>> ? ad(1,2) >>> </eucode> {{{ >>> >>> ... Euphoria prints the following error message on the screen: >>> -=-=-=-=-=-=-=-=-=-=-=-=- >>> C:\Desktop\test.exw:10 >>> ad has not been declared >>> ? ad(1,2) >>> ^ >>> -=-=-=-=-=-=-=-=-=-=-=-=- >>> (tested with exw.exe 2.4 and 2.5 alpha). >>> >>> But it should print my message instead, shouldn't it? >>> >>> >> i ran it with 2.4, dos and windows file types. it printed your crash message >> as you >> wanted. i simply cut and pasted your program. Thanks for checking it! I'm sorry, I must have made a mistake previously. Now testing it again, on Eu 2.4 ex.exe and exw.exe actually print my crash message. >> what happens when you turn off syntax checking? >> > > Maybe in 2.5 it only works with run-time errors, where this is a > parser/compile-time error. That would seem to be more correct behavior > anyway (the 2.5 way)... Using Eu 2.5 alpha, I still get the original Euphoria error message shown above. I also think that this probably might be "the 2.5 way". In this case, IMHO the 2.5 documentation for crash_message() should be changed accordingly. Regards, Juergen -- Have you read a good program lately?