This is a very useful solution to this and many other algorithmic problems, and I will use it.
However - in common with much code that uses function calls to set values ByRef - I still feel that this approach is less easy "on the eye" than my FROM idea. On 26/1/07 13:07, "Jonathan Johnson" <[EMAIL PROTECTED]> wrote: > > On Jan 26, 2007, at 6:52 AM, Daniel Stenning wrote: > >> Nope. you cannot pass object references BYRef - in other words you >> cannot >> set a passed reference INSIDE a method. You can set an intrinsic >> variable >> like that, but not a reference. Believe me I tried that ages ago. > > Sure you can. > > Function GetA( byref foo as AType ) as Boolean > ... > foo = a > return true > End Function > > dim a as AType > if GetA( a ) Then > ... > End If > > We use a similar technique as above for a particular circumstance in > the IDE that used to be error prone, involving nil checks, isa > checks, and more in several spots. However, we were able to use the > above, combined with overriding, to create a very easy, error-proof > way to get a reference to what we were looking for. > > HTH, > Jon > _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
