Solved

usage of Property function

Posted on 2002-07-18
2
175 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 50 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

623 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