472,122 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 software developers and data experts.

let and get

Can anyone explain me the joy of let and get. Once more, I read the
explanation in the help, but did not get much wiser.

I seem to learn best from examples, but I did not come across any good
ones...

Thank you Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004
Nov 13 '05 #1
9 14419
Let is how you set the value of a property of a class, Get is how you pass
the value back.

In your class, you'd have something like:

Private mstrBlah As String

Public Property Let Blah(Value As String)
mstrBlah = Value
End Property

Public Property Get Blah() As String
Blah = mstrBlah
End Property

Then, in your code that's instantiated an instance of MyClass, you'd have
something like:

MyClass.Blah = "zxy"

to call the Let property to assign a value for Blah to the instance of the
class, and

strBlah = MyClass.Blah

to call the Get property to retrieve that value.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:Oo*******************@news.xtra.co.nz...
Can anyone explain me the joy of let and get. Once more, I read the
explanation in the help, but did not get much wiser.

I seem to learn best from examples, but I did not come across any good
ones...

Thank you Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004

Nov 13 '05 #2
Let is how you set the value of a property of a class, Get is how you pass
the value back.

In your class, you'd have something like:

Private mstrBlah As String

Public Property Let Blah(Value As String)
mstrBlah = Value
End Property

Public Property Get Blah() As String
Blah = mstrBlah
End Property

Then, in your code that's instantiated an instance of MyClass, you'd have
something like:

MyClass.Blah = "zxy"

to call the Let property to assign a value for Blah to the instance of the
class, and

strBlah = MyClass.Blah

to call the Get property to retrieve that value.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:Oo*******************@news.xtra.co.nz...
Can anyone explain me the joy of let and get. Once more, I read the
explanation in the help, but did not get much wiser.

I seem to learn best from examples, but I did not come across any good
ones...

Thank you Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004

Nov 13 '05 #3
Dear Doug

I read your email a couple of times to understand it all and I think I do.
However, what I do not understand is the big picture. I worked out, it is
similar to for example

Frm.Caption = "Input form" as a let statement

and Str = Frm.Caption as a get statement

but when and how do you use this sort of stuff and where, how and for how
long does access store the value???

I hope this does not sound stupid or ignorant.

Thank you

Nicolaas


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:mR******************@news01.bloor.is.net.cabl e.rogers.com...
Let is how you set the value of a property of a class, Get is how you pass
the value back.

In your class, you'd have something like:

Private mstrBlah As String

Public Property Let Blah(Value As String)
mstrBlah = Value
End Property

Public Property Get Blah() As String
Blah = mstrBlah
End Property

Then, in your code that's instantiated an instance of MyClass, you'd have
something like:

MyClass.Blah = "zxy"

to call the Let property to assign a value for Blah to the instance of the
class, and

strBlah = MyClass.Blah

to call the Get property to retrieve that value.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:Oo*******************@news.xtra.co.nz...
Can anyone explain me the joy of let and get. Once more, I read the
explanation in the help, but did not get much wiser.

I seem to learn best from examples, but I did not come across any good
ones...

Thank you Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this

email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004


---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004
Nov 13 '05 #4
This is done in conjunction with classes. You've got another fairly lengthy
thread about classes in this newsgroup that hopefully explains what a class
is and when you'd use it.

When you assign a value to a instantiated class, that value should last for
as long as the class remains instantiated.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:q3********************@news.xtra.co.nz...
Dear Doug

I read your email a couple of times to understand it all and I think I do.
However, what I do not understand is the big picture. I worked out, it is
similar to for example

Frm.Caption = "Input form" as a let statement

and Str = Frm.Caption as a get statement

but when and how do you use this sort of stuff and where, how and for how
long does access store the value???

I hope this does not sound stupid or ignorant.

Thank you

Nicolaas


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:mR******************@news01.bloor.is.net.cabl e.rogers.com...
Let is how you set the value of a property of a class, Get is how you pass the value back.

In your class, you'd have something like:

Private mstrBlah As String

Public Property Let Blah(Value As String)
mstrBlah = Value
End Property

Public Property Get Blah() As String
Blah = mstrBlah
End Property

Then, in your code that's instantiated an instance of MyClass, you'd have something like:

MyClass.Blah = "zxy"

to call the Let property to assign a value for Blah to the instance of the class, and

strBlah = MyClass.Blah

to call the Get property to retrieve that value.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:Oo*******************@news.xtra.co.nz...
Can anyone explain me the joy of let and get. Once more, I read the
explanation in the help, but did not get much wiser.

I seem to learn best from examples, but I did not come across any good
ones...

Thank you Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004


---
Please immediately let us know (by phone or return email) if (a) this

email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004

Nov 13 '05 #5
Douglas J. Steele wrote:
This is done in conjunction with classes.


But let and get properties were enabled for standard modules in AC2K.
Nov 13 '05 #6
Yes, they were -- and are a useful way to wrap global variables. But their
primary purpose is for use in classes.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.

"Lyle Fairfield" <ly***********@netscape.net> wrote in message
news:2h************@uni-berlin.de...
Douglas J. Steele wrote:
This is done in conjunction with classes.


But let and get properties were enabled for standard modules in AC2K.

Nov 13 '05 #7
another dumb question, further to this let and get discussion.

Would it not be much easier to store values in a (temporary) table???

this just seems a lot more tangible.
"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> wrote in
message news:40******@news.microsoft.com...
Yes, they were -- and are a useful way to wrap global variables. But their
primary purpose is for use in classes.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.

"Lyle Fairfield" <ly***********@netscape.net> wrote in message
news:2h************@uni-berlin.de...
Douglas J. Steele wrote:
This is done in conjunction with classes.


But let and get properties were enabled for standard modules in AC2K.


---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004
Nov 13 '05 #8
Hi Nicolaas,

The thread is incomplete so I may be missing the point of your post. Also,
the first part I see is a response to an email???

If all you want to do is store values then a table will do it better than
anything else. I seem to recall a thread originated by you in the last few
days about classes so I assume this discussion is still about that.

First, a confession: I've been so busy doing other things and nothing at
all that I haven't really gotten into classes and objects. But I do know
that they are great! A class module is a "cookie cutter" you design it to
have all of the properties and behaviors that you want the objects of that
class to have. You can then create any number of instances of objects (the
cookies). If you want to change something about the class, you change it in
the class module and thereafter all of the objects you create from that
class will have the new behavior or properties.

Ken Getz has included a chapter or so in the last several editions of The
Access [YourVersion] Developer's Handbook from Sybex. Deborah Kurata has
written a few books about Doing Objects in Microsoft Visual Basic
[YourVersion].

Storage is more of an issue than you might have imagined. Variable
information that must persist across sessions must be stored in a file or
table.

To directly address your question about Let and Get: You can validate the
argument passed in with the let and be sure it fits your paradigm. You can
also have the Let initiate some other process inside your object which would
be beyond the capabilities of an Access table. The same is true of the Get.
Also, you are not making the actual variables visible to the using program,
only the properties via your code.

There are snippets of information available all over the internet but I
recommend going for a good book first.

HTH
--
-Larry-
--

"WindAndWaves" <ac****@ngaru.com> wrote in message
news:Cw********************@news.xtra.co.nz...
another dumb question, further to this let and get discussion.

Would it not be much easier to store values in a (temporary) table???

this just seems a lot more tangible.
"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> wrote in
message news:40******@news.microsoft.com...
Yes, they were -- and are a useful way to wrap global variables. But their primary purpose is for use in classes.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.

"Lyle Fairfield" <ly***********@netscape.net> wrote in message
news:2h************@uni-berlin.de...
Douglas J. Steele wrote:
> This is done in conjunction with classes.

But let and get properties were enabled for standard modules in AC2K.

---
Please immediately let us know (by phone or return email) if (a) this

email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004

Nov 13 '05 #9
Dear All,

I have really been doing a lot of reading here, thank you so much for all
your replies.

I know finally really understand this "let set get class module thing."
Great

Although I cannot really see where I should be using it, I definitely see
advantages. One of the biggest ones is the autocompletion (where you can
see all the methods and properties). That really simplifies working.

Thank you all once more for all your ideas.


---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004
Nov 13 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.