473,545 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what [] means?

A.M
Hi,

I am analysing a VB.NET code and i see this line of code:
Dim strCacheKey As String = [ProviderType] & "provider"

What is the role of [ ] ?

Thanks,

Allan


Nov 20 '05 #1
9 1227
"A.M" <IH*******@sapm 123.com> schrieb
Hi,

I am analysing a VB.NET code and i see this line of code:
Dim strCacheKey As String = [ProviderType] & "provider"

What is the role of [ ] ?


None, if it works without [ ].

[ ] is only required if you use keywords as an identifier.

For example, "MyClass" is a keyword. If you wanted to use it as a class
name, you'd have to write

class [MyClass]
end class
see also:
http://msdn.microsoft.com/library/en...amesInCode.asp

http://msdn.microsoft.com/library/en...ementNames.asp

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
It's used to declare a variable with the same name as a class/keyword,
etc...
"A.M" <IH*******@sapm 123.com> wrote in message
news:eK******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I am analysing a VB.NET code and i see this line of code:
Dim strCacheKey As String = [ProviderType] & "provider"

What is the role of [ ] ?

Thanks,

Allan


Nov 20 '05 #3
Or when referring to a class name that has the same name as a keyword. A
common example I've come across is the 'Assembly' class, which also happens
to be a VB keyword.

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:O8******** ********@TK2MSF TNGP12.phx.gbl. ..
It's used to declare a variable with the same name as a class/keyword,
etc...
"A.M" <IH*******@sapm 123.com> wrote in message
news:eK******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I am analysing a VB.NET code and i see this line of code:
Dim strCacheKey As String = [ProviderType] & "provider"

What is the role of [ ] ?

Thanks,

Allan



Nov 20 '05 #4
A.M
So why they put ProviderType inside bracket ? It seems that they don't need
doing that.

"A.M" <IH*******@sapm 123.com> wrote in message
news:eK******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I am analysing a VB.NET code and i see this line of code:
Dim strCacheKey As String = [ProviderType] & "provider"

What is the role of [ ] ?

Thanks,

Allan


Nov 20 '05 #5
Some people are just weird.

"A.M" <IH*******@sapm 123.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
So why they put ProviderType inside bracket ? It seems that they don't need doing that.

"A.M" <IH*******@sapm 123.com> wrote in message
news:eK******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I am analysing a VB.NET code and i see this line of code:
Dim strCacheKey As String = [ProviderType] & "provider"

What is the role of [ ] ?

Thanks,

Allan



Nov 20 '05 #6
A.M

Do we have similar feature in C#?
"A.M" <IH*******@sapm 123.com> wrote in message
news:eK******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I am analysing a VB.NET code and i see this line of code:
Dim strCacheKey As String = [ProviderType] & "provider"

What is the role of [ ] ?

Thanks,

Allan


Nov 20 '05 #7
Hi Allan,

I agree with Armin's suggestion.

Also based on my experience,C# does not support such feature so far.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #8

""Peter Huang"" <v-******@online.m icrosoft.com> wrote in message
news:h9******** ******@cpmsftng xa06.phx.gbl...
Hi Allan,

I agree with Armin's suggestion.

What "suggestion " did armin give?
Also based on my experience,C# does not support such feature so far.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #9
Hi,

Comment in line.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "CJ Taylor" <[cege] at [tavayn] dit commmmm>
References: <eK************ **@TK2MSFTNGP10 .phx.gbl> <#i************ **@TK2MSFTNGP09 .phx.gbl>
<h9************ **@cpmsftngxa06 .phx.gbl>Subject: Re: what [] means?
Date: Thu, 15 Apr 2004 08:32:46 -0500
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eP************ **@TK2MSFTNGP10 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.vb
NNTP-Posting-Host: mortonrb-2-adsl-233.mtco.com 207.179.235.234
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG XA06.phx.gbl!cp msftngxa10.phx. gbl!TK2MSFTNGXA 0
1.phx.gbl!TK2MS FTNGP08.phx.gbl !TK2MSFTNGP10.p hx.gblXref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:195575
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
""Peter Huang"" <v-******@online.m icrosoft.com> wrote in message
news:h9******* *******@cpmsftn gxa06.phx.gbl.. .
Hi Allan,

I agree with Armin's suggestion.

What "suggestion " did armin give?


I mean the link that Armin posts will explain how the [] is used in VB.NET.
Also based on my experience,C# does not support such feature so far.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no

rights.



Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

92
6343
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption? cheers, reed
125
14577
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
17
3473
by: Anoob | last post by:
Can we consider () unary operator when calling a function, in exps eq. f(), ( 1 + 2). But when we call function f( 10 ) it is a binary operator. Even if we pass f( 10, 20) as we are using , operator there one operand will be there for ()? And Unary operators like !, +, -, ~, ... are said to be having associativity right to left which means...
39
3038
by: VidTheKid | last post by:
THE PROBLEM The % symbol is too vague when defining dimensions in CSS and HTML. It can relate to an inherited value, a measure of the containing element (which can differ between box models) or for background image placement, the size of the element minus the size of the image. A SOLUTION There should be new %-like units defined in CSS to...
669
25599
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990....
10
2091
by: Franky | last post by:
I think I misread a post and understood that if I do: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor there is no need to reset the cursor to Default. So I made all the reset statements into comments (placed an ' in front)
9
2669
by: Cao Yi | last post by:
Hi, here's a fract of codes, and what's the line "scanf("%lf%*", &cvi)" doing? ============================= do { printf("\nCoefficient: "); scanf("%lf%*", &cvi); getchar(); } while (cvi <= 0.0);
5
1576
by: thermate | last post by:
Dr.Bricmont, We are extremely proud of you for your brilliant analysis and courage to come out and say it. Your article brings out not one but several key concepts, worth close reading. The physicists like myself are proud to have one among us like you who seems to have an acute sense of humanitarianism .... ================= January 31,...
89
5657
by: Tubular Technician | last post by:
Hello, World! Reading this group for some time I came to the conclusion that people here are split into several fractions regarding size_t, including, but not limited to, * size_t is the right thing to use for every var that holds the number of or size in bytes of things. * size_t should only be used when dealing with library functions.
167
8177
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an object should run in its own thread, it should implement this mix-in class. Does this sound like plausible design decision? I'm surprised that C++...
0
7487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7420
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7446
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5349
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.