[AccessD] First real stumble with using VB.Net over VB

Drew Wutka DWUTKA at Marlow.com
Thu Apr 14 14:43:23 CDT 2011


Well VBA is a subset of VB 6.  Can you show me any documentation where
it defines a Public statement as setting a 'field' to a class, versus
Property statement setting a property, in VBA?  When in the IDE, if you
have Public MyValue or Property Get MyOther value, both will show up
with the same 'property' icon in the IDE.  No declaration that 'MyValue'
(in this case) is a 'field' in the Object browser.

In .Net, it DOES have a different icon in the IDE.  Fields and
Properties are given completely different icons in autosensing drop
downs.  It makes a clear distinction.  

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Thursday, April 14, 2011 2:27 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] First real stumble with using VB.Net over VB

LOL.  Snarky?  I like it.

I never really did VB6 so i can't discuss that.  In VBA a field and a
property are not the same, and 
in .Net they are not the same so i assume the same for VB6.

"Considered a property" by who?  One says "property" in the definition
line and the other says 
public varname.  I certainly wouldn't consider them both properties.

;)

John W. Colby
www.ColbyConsulting.com

On 4/14/2011 2:01 PM, Drew Wutka wrote:
> Wow... a little snarky today, are we?
>
> Actually was describing a DIFFERENCE between VB 6 and VB.Net.  In VB
6,
> both were considered properties... and that isn't me 'protesting till
> the cows come home', it's how it is. If it's not, if you can show me
> some documentation that refers to 'Public SomeVariable As String' as
> being a FIELD in VB 6, I will gladly apologize and bow to your
superior
> knowledge.  ;)
>
> As for the lazy programmer comment..... who's the one that uses the
> 'canned' bound format?
>
> <BIG GRIN>
>
> Drew
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Thursday, April 14, 2011 4:39 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] First real stumble with using VB.Net over VB
>
> Drew,
>
>   >  Both create a 'property' called SomeValue.
>
> No they don't!  A field is *not* a property.
>
> A field stores data.
>
> A property is code that (may or may not) get / set a field.  Setting a
> field public makes it emulate
> a property which retrieves that field but the two are not the same
> thing.
>
>
> A property may or may not even reference data.  A property may simply
> return a hard coded value.
>
> property get SomeValue() as int
> 	SomeValue = 1/3
> end property
>
> You may protest till the cows come home that is not what *you* call a
> property, but none the less it
> is a property.
>
> Private int MyValue
>
> property Get myValue() as int
> 	return myValue
> end property
>
> MyValue is a field not a property.  It stores an integer.
>
> myValue is a property, it gets but does not allow the external world
to
> set, MyValue.
>
> Entirely different.
>
> I understand that you are a lazy programmer, we have had this
discussion
> before.  Your claim was
> IIRC that exposing your fields as public was much less work than
making
> them private and exposing
> them via properties, and properties were pretty much useless.  You
fell
> into the trap of thinking of
> them as the same thing.  Properties are very valuable constructs and
> exist for a reason.
>
> John W. Colby
> www.ColbyConsulting.com
>
> On 4/13/2011 6:22 PM, Drew Wutka wrote:
>> Figured I'd post this here, for those that may be tinkering or
> thinking
>> about tinkering with .Net.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI Business 
Sensitive material. If you are not the intended recipient, please contact the sender 
immediately and destroy the material in its entirety, whether electronic or hard copy. 
You are notified that any review, retransmission, copying, disclosure, dissemination, 
or other use of, or taking of any action in reliance upon this information by persons 
or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list