1. err.ex

What does it mean when i have a variable listed twice, like this:

    loop = 3062
    loop = 9

? How will i know which is correct, if either?
Kat

new topic     » topic index » view message » categorize

2. Re: err.ex

maybe they were different local variables with the same name?
(different variables in different routines, but using the same name)

Dan Moyer

----- Original Message ----- 
From: <gertie at visionsix.com>
To: "EUforum" <EUforum at topica.com>
Subject: err.ex


> 
> What does it mean when i have a variable listed twice, like this:
> 
>     loop = 3062
>     loop = 9
> 
> ? How will i know which is correct, if either?
> Kat
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
>

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

3. Re: err.ex

Kat writes:
> What does it mean when i have a variable listed twice, like this:
>
>    loop = 3062
>    loop = 9
>

That's a quirky "feature". 
It happens when you have more than one for-loop 
in the same routine, or same file, that uses the 
same loop variable name. Euphoria considers them
to be different variables, but with the same name.

> ? How will i know which is correct, if either?

It's usually pretty easy if you look at the trace back.
One or both values will probably be the final value
attained by a for-loop variable. Technically, one or
both loops will have terminated, so the variable(s)
don't exist anymore, and you probably don't care 
what the values are.

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

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

4. Re: err.ex

On 10 Jan 2003, at 1:56, Robert Craig wrote:

> 
> Kat writes:
> > What does it mean when i have a variable listed twice, like this:
> >
> >    loop = 3062
> >    loop = 9
> >
> 
> That's a quirky "feature". 
> It happens when you have more than one for-loop 
> in the same routine, or same file, that uses the 
> same loop variable name. Euphoria considers them
> to be different variables, but with the same name.
> 
> > ? How will i know which is correct, if either?
> 
> It's usually pretty easy if you look at the trace back.
> One or both values will probably be the final value
> attained by a for-loop variable. Technically, one or
> both loops will have terminated, so the variable(s)
> don't exist anymore, and you probably don't care 
> what the values are.

Actually, i did, or i wouldn't have been looking for them. It was blowing up in 
a loop, and knowing the value would have told me what (file) line was causing 
it.

I rewrote the block of code to use while and an exit.

Kat

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

Search



Quick Links

User menu

Not signed in.

Misc Menu