Results 1 to 6 of 6

Thread: class within a a class

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    88

    class within a a class

    i have created a couple of classes - clsCompany and clsKeyword. clsKeyword is a collection class that should only be viewable from with clsCompany.

    1.) how do i implement that?

    2.) how can i pass parameters to it so that i only return the keywords that would be associated with that particular instance?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can make clsKeyword Public not Creatable then other applications can use it but can not make new instances of it. That way you can have the clsCompany make the instances. I'm not sure what you mean with the second question but maybe that would fix both.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    88
    i've gotten as far as making my "Keyword" class "publicnotcreateable", but then i'm not sure exactly how to reference it from within my "company" class once i've done this. i'm a newbie to com and am having difficulty with syntax.

    as far as the parameters question, i want to return only the keywords unique to that company out of a table. that would require me passing the unique id of that company to the Keyword class. can i do this?

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well it is a little difficult to make an example without knowing more about the project but here is my attempt.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    88
    edneeis,

    thanks a lot! you're "attempt" was a lot more than the "nudge-in-the-right-direction" i was expecting to get. i'm currently reading through and trying to understand it. right off, i see you have a class for "Keyword" and a class for "Keywords". this may be the beginning of my problem. thanks for your time.

    dwhawley

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    No problem, let me know if I can do anything else to help and I'm glad that example helped some.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width