Results 1 to 5 of 5

Thread: Please Teach me!!

  1. #1

    Thread Starter
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    Hello All,

    Can anyone teach me how and where to use the Property Get, Let and Set. Pls give me some examples.

    Thank you. Its very urgent.

    Regards,

    Venkat.

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    This is how I think of them:

    Property Get is when the client is GETTING the information from your class

    Property Let is when the client is LETTING (assigning) the information to your class

    Property Set is when the client is SETTING OBJECTS in your class
    ==========================================

    You will also have private variables within your class that represent the values of the object. YOu use property let/set/get so you can validate the input before you assign a value to the internal variable, otherwise you can raise an error.

    HTH

    Tom

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Code Sample:
    Code:
    private m_lngOrderID as long
    
    Public Property Let OrderID(vNewValue as long)
        if vnewvalue > 0 then
            m_lngOrderID = vnewvalue
        else
            err.raise 1,"", "Invalid Order ID!"
        end if
    end property
    
    Public Property Get OrderID() as long
        orderid = m_lngOrderID
    end property

  4. #4

    Thread Starter
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    Hey, thanx pal..got little bit confidence and i would proceed with this.

    Regards,

    Venkat.

  5. #5
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    593

    Post

    Have a look at:
    http://www.vb-world.net/activex/activex/

    For a tutorial on ActiveX and controls.

    ------------------
    John Percival
    Editor, VB-World.net
    [email protected]



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