+ Reply to Thread
Results 1 to 5 of 5

the same question, revisisted

  1. #1
    Registered User
    Join Date
    11-14-2004
    Location
    Georgia
    Posts
    57

    Exclamation the same question, revisisted

    i hate to post this much code but i have no idea how to do this and i'm absolutley desperate. this thing is due tommorow and i have to know how to get this class to work right. all i need is one thing. so here's my "Sandwich" class:

    Please Login or Register  to view this content.

    (for readability, the property Lets and Gets are grouped.)

    so this is what i need: see how the property lets and gets for IngredientName/Amount have the parameters "Index" and "sAmount/Name"?
    well the reason i have this is to be able to set the variables by Index in a way, by calling it like this:
    Please Login or Register  to view this content.
    but i guess i just don't understand how Property Let/Get/Set methods work. and the Office help does nothing for me.

    i'm sorry if this is a stupid question or if i'm missing something easy, but this could be the one thing that lands me my dream job, so please help if at all possible.

    thanks a million before hand,
    stephen
    Brought to you by Pringles and his infinite genius. ~''~

    "Ctrl+Z is a beautiful thing."
    - Me.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Stephen,

    It's seems to me you would be better off placing this code into a VBA Module instead of a Class Module. Class modules are used to create in process server objects. What you are attempting is a regular macro.

    You should explore the User Type construct and Collection objects. These are most likely what you are really after. Your code needs to be revamped, but without knowing the original objectives that's not possible.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-14-2004
    Location
    Georgia
    Posts
    57
    no offense, but i know what i'm doing. the first code listing is my Sandwich Class ( i also have a Sandwiches collection class, which works fine)

    the second code listing is something i have in a code module that references each Sandwich object and returns the ingredients associated with each of them.

    i've been working on it a bit, and i have the Property Get procedures pretty well working fine, but the Lets are giving me trouble.

    what kind of call/method/whatever calls the property let procedure?
    oSandwich.property = ?
    varname = oSandwich.property ?

  4. #4
    Tom Ogilvy
    Guest

    Re: the same question, revisisted

    oSandwich.propertyName = "whatever" ' calls the Let procedure
    varname= oSandwich.propertyName ' calls the Get procedure

    --
    Regards,
    Tom Ogilvy


    "medicenpringles"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > no offense, but i know what i'm doing. the first code listing is my
    > Sandwich Class ( i also have a Sandwiches collection class, which works
    > fine)
    >
    > the second code listing is something i have in a code module that
    > references each Sandwich object and returns the ingredients associated
    > with each of them.
    >
    > i've been working on it a bit, and i have the Property Get procedures
    > pretty well working fine, but the Lets are giving me trouble.
    >
    > what kind of call/method/whatever calls the property let procedure?
    > oSandwich.-property = -?
    > - varname -= oSandwich.-property- ?
    >
    >
    > --
    > medicenpringles
    >
    >
    > ------------------------------------------------------------------------
    > medicenpringles's Profile:

    http://www.excelforum.com/member.php...o&userid=16458
    > View this thread: http://www.excelforum.com/showthread...hreadid=478593
    >




  5. #5
    Registered User
    Join Date
    11-14-2004
    Location
    Georgia
    Posts
    57
    after several hours of experimentation i finally figured it out. i had to do some crazy math, but it works like a charm. thanks for all the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1