realbasic-nug
[Top] [All Lists]

FR: allow ByRef to be used in For Each loops

To: "REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>" <realbasic-nug at lists dot realsoftware dot com>
Subject: FR: allow ByRef to be used in For Each loops
From: Daniel Stenning <d0stenning at msn dot com>
Date: Wed, 31 Oct 2007 21:01:53 +0000
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcgcAUNRgb8fo4f0EdyBNAAbY5KfzA==
Thread-topic: FR: allow ByRef to be used in For Each loops
http://www.realsoftware.com/feedback/viewreport.php?reportid=ofakdwwf

So I came across yet another irritating situation where I really wanted to
be able to use for each, but was forced to go back to the old syntax:
 
"for i=0 to blah"

I simply wanted to assign all elements in an object array to nil.
RB lets you code this using for each, only to find out that actually one is
just assigning a useless reference to nil, not the original element. This is
documented but easy to trip up on by mistake.

I need a syntax like this:

For Each val ByRef As myClass In myClassArray
 val = nil // set every element in the array to nil
Next

or

For Each val ByRef As Integer In MyNumArray
val = val +1 // increment every element in the array
Next

Here is the feature request:

http://www.realsoftware.com/feedback/viewreport.php?reportid=ofakdwwf


Cheers,
Dan




_______________________________________________
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>
  • FR: allow ByRef to be used in For Each loops, Daniel Stenning <=