One thing I don't really like is how the dim statement repeatedly
initialises. In my opinion it should only do this once.

Try running the following code:

  
  for i as integer = 0 to 5
    dim j as integer
    j =j+1
  Next

Here j is local in scope within the loop and in MY opinion should only get
initialised to zero ONCE, so j gets incremented.  In fact j will get
reinitialised to zero each time around, which to me just doesn't seem right.



On 2/5/07 15:10, "Glenn L.Austin" <[EMAIL PROTECTED]> wrote:

> On May 1, 2007, at 10:54 PM, Marc Zeedar wrote:
> 
>> I won't weigh in on this debate since I have no position, but I have
>> a question.
>> 
>> My experience is with variable declarations at the top so I haven't
>> gotten used to declaring them later in code, but I can see some value
>> in doing so. However, the one aspect that confuses me is how do you
>> "undeclare" a variable? Can you? I mean, how else would the variable
>> only be good for that block?
> 
> The subroutine *is* a block, so that variable is only available in
> that block.  Put the declaration inside the "then" clause of an "if/
> then" statement, and the variable is only available during the
> execution of the "then" clause.

Regards,

Dan



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

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

Reply via email to