realbasic-nug
[Top] [All Lists]

RE: Merits of nested DIM (WAS re: [ANN] RB Code Reports version 1.3)

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: RE: Merits of nested DIM (WAS re: [ANN] RB Code Reports version 1.3)
From: "Tim Hare" <tim at telios dot com>
Date: Mon, 30 Apr 2007 19:10:28 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Importance: Normal
Andy Dent wrote
>
> Quoting Thom McGrath <lists at thezaz dot com>:
>
> > Just curious, why is this considered a warning? Is there some kind of
> > overhead that I missed, or is it just messy code.
>
> > On Apr 30, 2007, at 4:48 PM, Brendan Murphy wrote:
> >
> >> and the second is to check for misplaced
> >> DIM statements (DIMs imbedded within blocks of code)
>
> Now that it is available (I moved up from 5.5 a few months ago), I
> quite frequently use it to guarantee scope of variables.

Note, however, that there is overhead associated with DIM in that it
initializes the variable; it isn't purely a scope thing.  Dimming a variable
inside a loop will add overhead to the loop and should be treated in the
same way as other loop invariants - move them outside the loop.

Tim

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.6.2/781 - Release Date: 4/30/2007
9:14 AM

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>