Click to See Complete Forum and Search --> : Please Teach me!!
venkatraman_r
Jan 2nd, 2000, 02:10 PM
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.
Clunietp
Jan 2nd, 2000, 02:14 PM
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
Clunietp
Jan 2nd, 2000, 02:16 PM
Code Sample:
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
venkatraman_r
Jan 2nd, 2000, 02:27 PM
Hey, thanx pal..got little bit confidence and i would proceed with this.
Regards,
Venkat.
John
Jan 2nd, 2000, 04:42 PM
Have a look at:
http://www.vb-world.net/activex/activex/
For a tutorial on ActiveX and controls.
------------------
John Percival
Editor, VB-World.net
john@vb-world.net
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.