1. Problem that causes error and warning

Hello Rob,

I stumbled across a tiny issue (Eu 2.5). The following code snippet of
course runs fine:

sequence myData, text
myData = "ABC"
text = "Look at " & myData
puts(1, text)


but when the 2nd line is missing, I get the following messages:

| C:\temp\test.exw:2
| variable myData has not been assigned a value
| --> see ex.err
| 
| Warning: local variable myData in test.exw is never assigned a value

So Euphoria reports an error AND a warning for the same problem here.
I think this can be confusing especially for beginners. Since an error
is more important than a warning, my suggestion is that Euphoria should
not show a warning message in cases like this.

Regards,
   Juergen

new topic     » topic index » view message » categorize

2. Re: Problem that causes error and warning

Juergen Luethje wrote:
> I stumbled across a tiny issue (Eu 2.5). The following code snippet of
> course runs fine:
> 
> }}}
<eucode>
> sequence myData, text
> myData = "ABC"
> text = "Look at " & myData
> puts(1, text)
> </eucode>
{{{

> 
> but when the 2nd line is missing, I get the following messages:
> 
> | C:\temp\test.exw:2
> | variable myData has not been assigned a value
> | --> see ex.err
> | 
> | Warning: local variable myData in test.exw is never assigned a value
> 
> So Euphoria reports an error AND a warning for the same problem here.
> I think this can be confusing especially for beginners. Since an error
> is more important than a warning, my suggestion is that Euphoria should
> not show a warning message in cases like this.

Thanks, but I'm not going to worry about this.
The warning and the error provide slightly different
information. The warning says that the variable 
*never* has a defined value, anywhere in the code,
while the error says that you executed some code that
needs the value of that uninitialized variable.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu