By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,990 Members | 2,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,990 IT Pros & Developers. It's quick & easy.

Determine if a string is a vb.net keyword

P: n/a
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.
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Bruce Parker" <bp********@nospam.nospam> schrieb:
Is there a simple way to determine if a string (i.e. "Alias") is a keyword
for VB.NET.


No.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a
This may help the OP, may not be in exactly the context he wants it, nut
nevertheless may help.

http://www.novicksoftware.com/UDFofW...KeywordBIT.htm
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eb**************@TK2MSFTNGP12.phx.gbl...
"Bruce Parker" <bp********@nospam.nospam> schrieb:
Is there a simple way to determine if a string (i.e. "Alias") is a
keyword
for VB.NET.


No.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
Thanks for the link. I have already implemented something similar but in
code. I would think there has to be something with reflection that would
help solve this problem.

Microsoft, please provide a response.

"Mr Newbie" wrote:
This may help the OP, may not be in exactly the context he wants it, nut
nevertheless may help.

http://www.novicksoftware.com/UDFofW...KeywordBIT.htm
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eb**************@TK2MSFTNGP12.phx.gbl...
"Bruce Parker" <bp********@nospam.nospam> schrieb:
Is there a simple way to determine if a string (i.e. "Alias") is a
keyword
for VB.NET.


No.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Nov 21 '05 #4

P: n/a
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.

Nov 21 '05 #5

P: n/a
Thanks for the reply. I did not realize the keywords were not part of a
namespace but were a part of the compiler.

""Peter Huang" [MSFT]" wrote:
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.

Nov 21 '05 #6

P: n/a
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.

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.