Another way to do this currently, using slightly less lines ( I think ) could be to use GOTO - which of course is VERY BASIC ;) but I wont even go there..
On 26/1/07 06:06, "Daniel Stenning" <[EMAIL PROTECTED]> wrote: > Ok - to illustrate how useful this would be - here is how it could be used > with the new syntax: > > Dim myRef As myClass > > if myRef FROM getA() <> nil then > .. do something with myRef > elseif myRef FROM getB() <> nil then > .. do something with myRef > elseif myRef FROM getC() <> nil then > .. do something with myRef > end if > > 1 * IF > 2 * ELSEIF > 1 * END IF > TOTAL = 4 lines for the branching > > And here is how this would have to be written in RB currently: > > Dim myRef As myClass > > myRef = getA() > if myRef <> nil then > .. do something with myRef > Else > myRef = getB() > if myRef <> nil then > .. do something with myRef > else > myRef = getC() > if myRef <> nil then > .. do something with myRef > end if > end if > End if > > 3 * if > 2 * else > 3 * end if > TOTAL = 8 lines for the branching. > > > The forner is much clearer in meaning. > > > On 26/1/07 01:44, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >> I also don't see how you >> can say that it makes for simpler to read code. Perhaps it is >> occasionally useful, but those times are pretty rare IMHO. > > > _______________________________________________ > 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> > _______________________________________________ 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>
