Help, what am I doing wrong???

Jon jbondy at sover.net
Sun Jul 31 15:15:53 EDT 2005


Mark:

The point I was TRYING to make <grin> was that FOR loop variables 1) had 
to be declared locally; and 2) could not be modified inside a loop.  I 
was trying to make a general case for this kind of a definition of an 
"error". 

:)

Jon


Mark Wieder wrote:

>Jon-
>
>Sunday, July 31, 2005, 5:59:01 AM, you wrote:
>
>J> It has been considered a bug, and flagged for the programmer,  in Delphi
>J> for years.  I don't see how it can be considered anything else. Now as
>J> to whether it is a bug that is reported in Rev with an error message,
>J> that is a different story.
>
>I wasn't aware that Delphi even *had* a "for each" element construct,
>but then I haven't kept up with Delphi since v6.0 or so. Now that I've
>googled it, I see that Borland added foreach support to Delphi 2005.
>The documentation, though, clearly states that the loop indices are
>provided as read-only references only and cannot be modified. Works
>the same way in C#, in case you're interested.
>
>Since this is a brand-new addition to Delphi, I'm not sure what you're
>referring to in "has been considered a bug...for years". Nor how this
>can be considered a bug, since it's clearly documented.
>
>Personally, I prefer either the Perl or PHP implementations, where
>you're free to use and modify the element since it's separate from the
>loop index. Messing with a loop index is always a Bad Idea.
>Interestingly, in Perl changing the loop element changes the original
>referenced element, while in PHP the original value is unchanged.
>
>  
>



More information about the use-livecode mailing list