And since my discovering that RB now can set object references ByRef that is the way I will be getting around the if/elseif problem too.
However it has to be said that this involves either rewriting the get() methods/functions or writing an extra wrapper function. In some situations ( for example when using Declare functions ) one might not be able to rewrite the get(). And in performance sensitive situations ( for example where the code is being repeated thousands of times ) the overhead of the extra wrapper function call could be an issue. Having said all that I'll just have to put up my hands and say "you win, its a fair cop guvnor" or "ok constable - I'll come quietly" ;) On 26/1/07 16:40, "Tim Jones" <[EMAIL PROTECTED]> wrote: > On Jan 26, 2007, at 9:36 AM, Tim Jones wrote: > >> How about this code: >> >> Dim myRef As MyClass >> >> Function getA(ByRef myRef As MyClass) As Boolean >> // Same for getB and getC >> // stuff to set the contents of myRef >> If it_Is_True >> Return True >> else >> Return False >> end if >> End Function >> >> If Not getA(myRef) Then >> // Do that stuff >> ElseIf getB(myRef) Then >> // Do the other stuff >> ElseIf getC(myRef) Then >> // Do the last stuff >> Else >> // something went horribly wrong and the world will now reboot >> End If > > Of course, I just saw Jon's mail in the other thread on this ... Jon > and I must sometimes drink from the same coffee pot :). > > Tim > -- > Tim Jones > [EMAIL PROTECTED] > _______________________________________________ > 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>
