[openbeos] Re: Open-beos-cvs digest, Vol 1 #1587 - 8 msgs

  • From: "Jared Eldredge" <jared@xxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Thu, 15 May 2003 10:01:15 -0400 EDT

> That can't be true.  I've always been able to do that.  I've used 
> Visual
> Studio 1.5, 4, 5, 6, and .NET.  Maybe you mean that previous versions
> allowed you to use the variable declared in the for() after the end 
> of the
> for loop.  .NET has an option to use the old scoping rules or the new
> scoping rules.  Though I'm not too certain which is the default since 
> I
> don't use variables I declare in the for loop after the loop.  Well, 
> at
> least not since I started using gcc for BeOS programming.

i can through in my two bits and say for certain that if in vc++6 (yes 
6, i'm allergic to anything that says .NET in caps) the scoping method 
prevents you from compiling if you declare the same iterator in more 
than one for loop.

ie: the following will NOT compile in vc++6
{
        for (LinkedNode* p; p; p=p->nextNode())
                p->displaySomething();
        for (LinkedNode* p; p; p=p->nextNode())
                p->displaySomethingElse();
}

it will fail because the pointer p is already defined - and cannot be 
redefined in the second loop.  
ANSI C specs require this though.
so as i saw someone else ask, who won?  i'm confused by the original 
post.  assuming that there was a need to post it which was brought 
about by something in vc++7 i think it was meant to say that MS is now 
following [this] ANSI C spec.

while, thats my two bits (no pun intended)
-jared

> 
> 
> Scott MacMaster
> 
> ----- Original Message ----- 
> From: "Solaja, Zenja" <solaja@xxxxxxxxxx>
> To: <openbeos@xxxxxxxxxxxxx>
> Sent: Wednesday, May 14, 2003 8:15 PM
> Subject: [openbeos] Re: Open-beos-cvs digest, Vol 1 #1587 - 8 msgs
> 
> 
> > Well VC++ 7 (yep, the .NET one) now allows variable initialisation 
> > in the
> > body of the loop.  Therefore:
> > for(int32 i = 0...)
> > is now legal in VC++7.  Previous versions (VC++6 and lower) were 
> > cripled,
> as
> > usual.
> > Back into my hole...
> >
> > -----Original Message-----
> > From: Axel Dörfler [mailto:axeld@xxxxxxxxxxxxxxxx]
> > Sent: Thursday, 15 May 2003 10:03 AM
> > To: Open BeOS
> > Subject: [openbeos] Re: Open-beos-cvs digest, Vol 1 #1587 - 8 msgs
> >
> >
> > Hi,
> >
> > Bill Hayden just did the following to Shape.cpp:
> >
> > > Log Message:
> > > Conform to new scoping rules for variables defined in a for loop
> > >  status_t err = BArchivable::Archive(archive, deep);
> > > + int32 i;
> > > @@ -186,7 +187,7 @@
> > > - for (int32 i = 1; i < data->ptCount; i++)
> > > + for (i = 1; i < data->ptCount; i++)
> > >  archive->AddPoint("pts", data->ptList[i]);
> >
> > Have I missed the evolution? What new scoping rules? Did M$ win? I
> > always hated VC++ for that...
> >
> > Adios...
> >    Axel.
> >
> >
> > -------------------------------------------------------------------
> > ---
> > IMPORTANT NOTICES
> > This email (including any documents referred to in, or attached, to 
> > this
> > email) may contain information that is personal, confidential or 
> > the
> subject
> > of copyright or other proprietary rights in favour of Aristocrat, 
> > its
> > affiliates or third parties. This email is intended only for the 
> > named
> > addressee. Any privacy, confidence, copyright or other proprietary 
> > rights
> in
> > favour of Aristocrat, its affiliates or third parties, is not lost 
> > because
> > this email was sent to you by mistake.
> >
> > If you received this email by mistake you should: (i) not copy, 
> > disclose,
> > distribute or otherwise use it, or its contents, without the 
> > consent of
> > Aristocrat or the owner of the relevant rights; (ii) let us know of 
> > the
> > mistake by reply email or by telephone (+61 2 9413 6300); and (iii) 
> > delete
> > it from your system and destroy all copies.
> >
> > Any personal information contained in this email must be handled in
> > accordance with applicable privacy laws.
> >
> > Electronic and internet communications can be interfered with or 
> > affected
> by
> > viruses and other defects. As a result, such communications may not 
> > be
> > successfully received or, if received, may cause interference with 
> > the
> > integrity of receiving, processing or related systems (including 
> > hardware,
> > software and data or information on, or using, that hardware or 
> > software).
> > Aristocrat gives no assurances in relation to these matters.
> >
> > If you have any doubts about the veracity or integrity of any 
> > electronic
> > communication we appear to have sent you, please call +61 2 9413 
> > 6300 for
> > clarification.
> 


Other related posts: