Re: What does this notation mean?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Ricardo" <ricardo@xxxxxxxxxxxxxxxxxxx> wrote in message
news:11vjl85ig419568@xxxxxxxxxxxxxxxxxxxxx
Hi, I thought I'd create a class in my VB6 and a collection to go along
with
it. On looking through the collection I came across ".[_NewEnum]" in the
property below and wondered what it meant. Actually I'm a bit confused by
the whole definition of the property.

Any clarification on this would be much appreciated.

Thanks

Public Property Get NewEnum() As IUnknown
'this property allows you to enumerate
'this collection with the For...Each syntax
Set NewEnum = mCol.[_NewEnum]
End Property


"_NewEnum" is the actual COM name for the enumerator, but an underscore "_"
is an illegal first character in a name in VB so it has to be 'escaped' with
the "[...]" characters.

Using square brackets to escape names also shows up in VB when one uses
spaces in Field/Column names or when one encounters such names as also being
keywords or functions, ie [Yesterday Date] or [Date].

It is also used in Function/Sub Declarations when an API function name
starts with an underscore.

-ralph


.



Relevant Pages

  • Re: RegEx - Chk for special chars
    ... On 30.04.2007 01:37 M Kinnear wrote: ... of the other special/reserved characters. ... is there clarification on whether characters need to be escaped ... you also have to escape dollar sign when it comes before a letter. ...
    (comp.lang.php)
  • Re: RegEx - Chk for special chars
    ... of the other special/reserved characters. ... is there clarification on whether characters need to be escaped ... websites/posts state they should be escaped, ... you also have to escape dollar sign ...
    (comp.lang.php)