Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

usage of Property function

Posted on 2002-07-18
2
Medium Priority
?
177 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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

972 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