Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Difference Between LET and SET Properties

Posted on 2004-03-20
4
Medium Priority
?
609 Views
Last Modified: 2012-05-04
Set properties can take object as parameter value.But Let can also take variant which can accept object.So what is differnce in LET and SET
0
Comment
Question by:sanjusambhe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 22

Expert Comment

by:cookre
ID: 10643141
0
 
LVL 1

Accepted Solution

by:
SubodhKatiyar earned 500 total points
ID: 10657043
let properties are used for changing non object variable types inside class
for example say you have a class with property color which stores the value of color in some local m_var as a long inside class you can use let.
public propery let color(somecolor as long)
m_color=somecolor 'notice this property can only take basic var types
end property
but if you have a connection object inside your class defined as
dim mconn as adodb.connection '(not new connection)
and you want the users of this class to provide their own connection to your class so that you use existing connection of the clients,you will use the set property which is optimized for accepting objects as parameter.
inside the code block for the set property you would do this.
public property set setconn(someconn as adodb.connection)
set  m_conn=someconn 'you just received a object pointer and set it to your obect pheww.
end property

hope it is clear now.
set properties are great i use them extensively for reusing connection objects.

take care
0
 
LVL 1

Expert Comment

by:SubodhKatiyar
ID: 10657069
and using variants is an expensive operation you are passing in vt the type of object you want to use and it is dereferenced from there,why would some one pass a pointer inside a variant which would then be reread and vb will find the type o object it has and later on every processing is done using the same route of reading discovering and executing,where as you have one direct way of doing the same.
its like there is if then endif and iif also
different purpose different things.
regards.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Introduction to Processes
Screencast - Getting to Know the Pipeline

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question