Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

usage of Property function

Posted on 2002-07-18
2
Medium Priority
?
176 Views
Last Modified: 2010-05-02
Hi

I want to know how to utilize the Property Function.
eg,

Public Property Let AppVersion(sVersion as String)
   lblAppVersion = sVersion
End Property

Where lblAppVersion is a Label control in a form.

What is the above statement trying to achieve ?
I mean, is it like a function or procedure where
we need to call it somewhere in our code.

Pls advice.

Thanks & Rgds
Heng03







0
Comment
Question by:heng03
[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 Comments
 

Accepted Solution

by:
Amitabh earned 200 total points
ID: 7164109
you can use property procedures to assign(let) or fetch(get) values from your component.

Suppose you make a component(e.g a dll) "customer" and now you don't want the user to have access to the variable "name" which u r using inside your component at many places. Now what u can do is to add a property cust_name. you must be knowing how to do that...just go to tools -> procedure and add property. give name as cust_name.

soon you will see two procedures let and get in ur window. now when u will make a object of ur component customer like this.

dim myobj as new customer

myobj.cust_name="David"
As soon as u say the above let property procedure is called and it assigns "name" the value "David"

similarly when you say
Text1.text=myobj.cust_name

Get is called and the value stored in variable "name" is fetched.

hope this helps you.
0
 

Author Comment

by:heng03
ID: 7164166
Hi Amitabh

Thanks for your answer.
It is clear to me now.

Rgds
Heng03
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

721 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