Difference between Structure elements and Structure Members

Sougata Ghosh 161 Reputation points
2021-04-24T19:03:20.617+00:00

In the MSDN documentation (structures-and-classes) where they discuss similarities of classes and structures, the following is stated:

Both have members, which can include constructors, methods, properties, fields, constants, enumerations, events, and event handlers. However, do not confuse these members with the declared elements of a structure.

Can someone please explain that for a structure in VB, what is a difference between an element of a structure and a member of a structure? The documentation quoted above says that we should not confuse them....and I am very much confused.

Regards
Sougata

Developer technologies VB
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Xingyu Zhao-MSFT 5,381 Reputation points
    2021-04-26T05:59:07.11+00:00

    Hi @Sougata Ghosh ,

    See : Declared Elements in Visual Basic

    A declared element is a programming element that is defined in a declaration statement. Declared elements include variables, constants, enumerations, classes, structures, modules, interfaces, procedures, procedure parameters, function returns, external procedure references, operators, properties, events, and delegates.

    Best Regards,
    Xingyu Zhao
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Duane Arnold 3,216 Reputation points
    2021-04-26T07:27:17.59+00:00

    However, do not confuse these members with the declared elements of a structure.

    Declared means variables, members, etc., etc. are declared at structure initialization and are at the procedural-scope that can be accessed globally as opposed to defining them at the module scope used at the model level only. So it's talking about scope access and do not confuse the two scopes.

    An element is anything that is part of the whole. Variables, members, etc. and etc. are elements of a structure or class as a whole, just like your finger a part is an element of your body as a whole.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.