Determine if a string is a vb.net keyword

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a simple way to determine if a string (i.e. "Alias") is a keyword
for VB.NET.

I could create a list of keywords, and loop through them, but I was hoping
for something more reliable.
 
Hi

The System.Reflection namespace contains classes and interfaces that
provide a managed view of loaded types, methods, and fields, with the
ability to dynamically create and invoke types. So the reflection is to do
with the type definition in the assembly but not the compilication issue.
It should be the Compiler's job to recognize the keyword and do
compilation. But vbc.exe(the vb.net compiler) did not expose such interface
to check if certian string is a keyword.

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.
 
Thanks for the reply. I did not realize the keywords were not part of a
namespace but were a part of the compiler.
 
Hi

You are welcomed!

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.
 

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