Using reserved keyword as method name

  • Thread starter Thread starter Shayne H
  • Start date Start date
S

Shayne H

Is it possible to apply some attribute to allow the use of a reserved
keyword as a name for a class member?
eg

Class Foo
Sub Stop()
...
End Sub
End Class

I thought it might be possible because the System.Timers.Timer has a Stop
method.
 
Yes.

Class Foo
Sub [Stop]()
...
End Sub
End Class

HTH

Charles
 
Shayne H said:
Is it possible to apply some attribute to allow the use of a reserved
keyword as a name for a class member?

Class Foo
Sub Stop()
...
End Sub
End Class

I thought it might be possible because the System.Timers.Timer has a Stop
method.

Put the name into square brackets: 'Sub [Stop]'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top