|
-
Jan 2nd, 2000, 03:10 PM
#1
Thread Starter
Hyperactive Member
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.
-
Jan 2nd, 2000, 03:14 PM
#2
Guru
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
-
Jan 2nd, 2000, 03:16 PM
#3
Guru
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
-
Jan 2nd, 2000, 03:27 PM
#4
Thread Starter
Hyperactive Member
Hey, thanx pal..got little bit confidence and i would proceed with this.
Regards,
Venkat.
-
Jan 2nd, 2000, 05:42 PM
#5
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|