Hi Brian,
In your examples:
Dim bytes(1024) As [Byte]
Dim data As [String] = Nothing
they do absolutely nothing (which is why they get removed without loss).
In this, though:
Dim [Byte](1024) As Byte
Dim [String] As String = Nothing
[String] = "Poor choice of variable name"
the [] around the names allows you to use a reserved word. The compiler
won't object because you're telling it that you know what you're doing.
Very few people would want to call their variables Byte or String but it's
allowed when [] is used.
Here's a decent example:
Class StopWatch : Inherits Clock
Public Sub Start
'Note the start time.
End Sub
Public Sub [Stop]
'Record the time taken.
End Sub
End Class
'Stop' is a reserved word but it's more than reasonable that a StopWatch
has a Stop method!! So it needs the [] around it in the declaration.
However, in use, unlike the [Byte] and [String] above, you wouldn't need
the [] with Stop because it will be partnered with a StopWatch object.
oStopWatch.Start
'Do something
oStopWatch.Stop
Console.WriteLine (oStopWatch.Elapsed ("ms"))
For the compiler there's no possibilty that the 'Stop' in oStopWatch.Stop
is a reserved word so the [] are not needed.
Regards,
Fergus
--
(Please ignore this - there's a feud going on)
==================================================
Quote of the day
Herfried:
I don't need/want human interaction.
==================================================