|
-
Mar 8th, 2010, 04:24 PM
#1
[RESOLVED] Variable Name Decalration with []
In this
Dim [end] As Point = e.Location
what is the significance of the [] 's?
-
Mar 8th, 2010, 04:35 PM
#2
Re: Variable Name Decalration with []
same as it is in SQL... prevents the variable end from being confused with the keyword End. Personally I think it's a poor choice for a variable name, but hey, what ever works.
-tg
-
Mar 8th, 2010, 04:40 PM
#3
Re: Variable Name Decalration with []
It was just something I came across, and the choice of the name was fitting (it was the end of a line). Thanks!
-
Mar 8th, 2010, 06:46 PM
#4
Re: [RESOLVED] Variable Name Decalration with []
tg, why would you use it in this scenario?
vb Code:
for each... in [enum].getvalues
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 8th, 2010, 07:27 PM
#5
Re: [RESOLVED] Variable Name Decalration with []
'Enum' is a reserved word in VB, so to specify the System.Enum class, you either have to fully qualify it or use [Enum]. The VS IDE will normally do this for you automatically.
(the same is true of System.Delegate, System.Reflection.Assembly, and System.Reflection.Module - if you don't fully qualify the type, you'll need the square brackets).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|