[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

UserMemId in class source

Jim Archer

1/11/2012 12:21:00 AM

Ok, so I'm having to do some "merging" of old source code vs. new (using
UltraCompare) and I noticed in one of these sources, in a .cls file, I'm seeing
this after some, but not all subs, right after a "Public Sub(blah blah)" line.
It's only in one of the files. But since it's nearly the same file, I don't
know why it's not in both. Being "Mem" (memory), I'm wondering if I should keep
those there or if it's ok to remove them. I'd also like to know why they're
there. I don't remember making a setting that added them, but I suppose I could
have at some point.

I did some research, but couldn't find much about it. I was hoping one of you
VB Classic oracles could shed some light on it. :)

Here's what I'm seeing in my text editor:

Public Sub(ByVal blah blah)
Attribute MySub.VB_UserMemId = 1610809355
'Whatever normal source code here
End Sub



--
--------------------------------- --- -- -
Posted with NewsLeecher v5.0 Beta 12
Web @ http://www.newsleecher.c...
------------------- ----- ---- -- -

9 Answers

BeeJ

1/11/2012 12:50:00 AM

0

Try
http://www.networkautomation.com/automate/urc/resources/help/definitions/Sbe6_000Attribute_DefinintionSta...



--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

Jim Archer

1/11/2012 4:03:00 PM

0

In reply to "BeeJ" who wrote the following:
> Try
> http://www.networkautomation.com/automate/urc/resources/help/de...
> Sbe6_000Attribute_DefinintionStatement.htm

Thanks BeeJ! That helps some. It says:

VB_UserMemID - Declares Property procname as the default property for a class
module or object module.

It's kind of vague though. I still don't know really know what it does, or if
it's safe to remove. Is this set somewhere in the interface? Does VB6 set it
all by itself?




--
--------------------------------- --- -- -
Posted with NewsLeecher v5.0 Beta 12
Web @ http://www.newsleecher.c...
------------------- ----- ---- -- -

unknown

1/11/2012 4:18:00 PM

0

Jim Archer wrote:
> In reply to "BeeJ" who wrote the following:
>> Try
>> http://www.networkautomation.com/automate/urc/resources/help/de...
>> Sbe6_000Attribute_DefinintionStatement.htm
>
> Thanks BeeJ! That helps some. It says:
>
> VB_UserMemID - Declares Property procname as the default property for
> a class module or object module.
>
> It's kind of vague though. I still don't know really know what it
> does, or if it's safe to remove. Is this set somewhere in the
> interface? Does VB6 set it all by itself?

Open the source in the IDE, then go to Tools-->Procedure Attributes, then
click on Advanced. "Procedure ID" is where you set the default property or
method.



Bob Butler

1/11/2012 4:19:00 PM

0


"Jim Archer" <nospam@nothanx.com> wrote in message
news:jNadnf7NQdpeL5DSnZ2dnUVZ_oqdnZ2d@giganews.com...
> In reply to "BeeJ" who wrote the following:
>> Try
>> http://www.networkautomation.com/automate/urc/resources/help/de...
>> Sbe6_000Attribute_DefinintionStatement.htm
>
> Thanks BeeJ! That helps some. It says:
>
> VB_UserMemID - Declares Property procname as the default property for a
> class
> module or object module.

It does more than that

> It's kind of vague though. I still don't know really know what it does,
> or if
> it's safe to remove. Is this set somewhere in the interface? Does VB6
> set it
> all by itself?

click in the procedure and use Tools /Procedure Attributes from the VB menu
bar. changing settings there will set this attribute and possibly others

BeeJ

1/11/2012 10:57:00 PM

0

I think you are dealing with the Attribute that says that the method is
the default method of the class.
This allows you to omit the member name.
In the following, Value is the member name.

<snip> from a google search
Range("A1") = 1234
' is the same as
Range("A1").Value = 1234
Because Value is the default member, it may be omitted in the code.

Personally I prefer to spell it all out.


Karl E. Peterson

1/12/2012 12:13:00 AM

0

BeeJ explained on 1/11/2012 :
> default method of the class.
> This allows you to omit the member name.

Evil, defined.

--
..NET: It's About Trust!
http://vfre...


ralph

1/12/2012 4:33:00 AM

0

On Wed, 11 Jan 2012 16:13:16 -0800, Karl E. Peterson <karl@exmvps.org>
wrote:

>BeeJ explained on 1/11/2012 :
>> default method of the class.
>> This allows you to omit the member name.
>
>Evil, defined.

lol

I never found the concept of a default method all that evil.

It is just one of those things that seemed a good idea within the
context of the times and had to be tried at least once in a high-level
language*.

There are three closely related reasons for a default properties.
1) It allows one to treat the object as a simple abstraction.
For example, a "Textbox" is a gimmick for managing text, thus what is
more natural than ...
TextboxA = "This is the string"
ResultText = TextboxA
2) It allows the same abstraction no matter what the actual
method/property might be 'called'. For example ...
TextboxA = "A string" ' TextboxA.Text
LabelA = "A string" ' LabelA.Caption
SomeObj = "A string" ' SomeObj.Value
[The language is sematically the same for the same abstraction.]
3) It allows for precise dereferencing when using the Dictionary
Lookup operator (the bang "!" operator) on simple and nested
collections.

Back then simpler abstractions and simpler constructs equaled simpler
coding, or so the thinking went. Only time and experience demonstrated
that maybe it wasn't such a good idea after all. lol

-ralph
[* Actually it was tried with several languages/platforms.]

Jeff Johnson [MVP: VB]

1/12/2012 5:09:00 PM

0

"ralph" <nt_consulting64@yahoo.net> wrote in message
news:0iksg79a6dq55pdtjk9i64bid4u480u176@4ax.com...

>>> default method of the class.
>>> This allows you to omit the member name.
>>
>>Evil, defined.
>
> lol
>
> I never found the concept of a default method all that evil.

Agreed.


Karl E. Peterson

1/12/2012 5:45:00 PM

0

ralph used his keyboard to write :
> On Wed, 11 Jan 2012 16:13:16 -0800, Karl E. Peterson <karl@exmvps.org>
> wrote:
>
>> BeeJ explained on 1/11/2012 :
>>> default method of the class.
>>> This allows you to omit the member name.
>>
>> Evil, defined.
>
> lol
>
> I never found the concept of a default method all that evil.

If they weren't there, we wouldn't have to deal with the whole Set/Let
thing. Besides, defaults can be changed (something I shouldn't have to
say here, of all places! <g>), which offers others the opportunity to
break your code.

--
..NET: It's About Trust!
http://vfre...