Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What should I return ...
Message
From
05/02/2003 19:13:31
 
 
To
05/02/2003 18:14:47
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00749629
Message ID:
00749648
Views:
24
Carole,

I haven't really studied your post enough to make an intelligent comment on it.. I'm sure Garrett will help you in that better than I could. But that's not why I'm replying.

I noticed you work for the Fred Hutchinson Cancer Research Center.

I wanted to let you know that 20 years ago or so my wife's brother was treated there for Leukemia and made a full recovery. My wife and brother say that Fred Hutch is TOP NOTCH. To this day, FHCRC calls him regularly to see how he is doing. My wife says that they are continuing to do great and pioneering work in Cancer Research.

So, I just wanted to let you know that I think you work for a great organization, and a great cause, and keep up the good work!

David


>I am creating class that builds a tree of objects and ending up with a collection of collections. See below. I am getting the impression that a procedure call like this:
>
>loFooBranch = CreateObject([Collection])
>loFooBranch = this.getFee(Feepk, loFooBranch)
>
>May be bad practice. In the procedure getFee another object is added to the loFooBranch passed.
>
>Should I be doing this instead?
>
>loFooBranch = CreateObject([Collection])
>loFiReturn = this.getFee(Feepk)
>loFooBranch.add(loFiReturn.name, loFiReturn)
>
>
>Any thoughts?
>
>
>SOME SAMPLE CODE:
>
>do test
>
>procedure test
>
>  lotree = createobject('treecollection')
>  loreturntree = lotree.getFoo([1])
>
>  return .t.
>
>endproc
>
>
>define class treecollection as collection
>
>  procedure init
>    use FeeData in 0
>    use FooData in 0
>    select 0
>    use FiData
>    index on Fipk tag Fipk
>
>  endproc
>
>  procedure getFoo (tcpk)
>
>    sele Feepk from FooData where Foopk = tcpk group by Feepk into cursor FeeCursor
>
>    if reccount() = 0
>      return .f.
>    else
>      loFooBranch = createobject([collection])
>      loFooBranch.name = transform(Feepk)
>    endif
>
>    scan
>      loFooBranch = this.getFee(Feepk, loFooBranch)
>    endscan
>
>    toMyRoot.add(loFiBranch.name,loFiBranch)
>
>    return toMyRoot
>
>  endproc
>
>  procedure getFee (tcpk, toMyRoot)
>
>    sele Fipk from FeeData where Feepk = tcpk group by Fipk into cursor FiCursor
>
>    if reccount() = 0
>      return .f.
>    else
>      loFeeBranch = createobject([collection])
>      loFeeBranch.name = transform(Fipk)
>    endif
>
>    scan
>      loFeeBranch = this.getFi(Fipk, loFeeBranch)
>    endscan
>
>    toMyRoot.add(loFeeBranch.name,loFeeBranch)
>
>    return toMyRoot
>
>  endproc
>
>  procedure getFi (tcpk, toMyRoot)
>
>    sele Fipk from FiData where Feepk = tcpk group by Fipk into cursor FiCursor
>
>    if reccount() = 0
>      return .f.
>    else
>      loFiBranch = createobject([collection])
>      loFiBranch.name = transform(Fipk)
>    endif
>
>    scan
>      loFiBranch.add(loFiBranch.name, Fipk)
>    endscan
>
>    toMyRoot.add(loFiBranch.name, loFiBranch)
>
>    return toMyRoot
>
>  endproc
>
>enddefine
>
>
>
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform