1. crash_message() problem

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?

new topic     » topic index » view message » categorize

2. Re: crash_message() problem

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: crash_message() problem

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?

new topic     » goto parent     » topic index » view message » categorize

4. Re: crash_message() problem

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: crash_message() problem

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)...

new topic     » goto parent     » topic index » view message » categorize

6. Re: crash_message() problem

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

new topic     » goto parent     » topic index » view message » categorize

7. Re: crash_message() problem

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. smile

>> 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?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu