473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Determine if a string is a vb.net keyword

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
6 1404
"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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Casey Hawthorne | last post by:
Is there a way to determine -- when parsing -- if a word contains a builtin name or other imported system module name? Like "iskeyword" determines if a word is a keyword! -- Regards, Casey
3
by: mikeorb | last post by:
Is there a way to determine the object that a property is in? For example: function MyClass() { ... } MyClass.prototype.myFunc = function() { ... } var obj = new MyClass(); var sameobj =...
15
by: Chuck Bowling | last post by:
I'm having problems doing an efficient keyword search on a text file likely to be smaller than 100k. I have a keyword list of about 200 strings and I need to search the file and mark all of the...
0
by: Siegfried Heintze | last post by:
This program works fine on my desktop when I grant full control of the MSAccess database to everyone. However, when I put it on my hosting service with no impersonation, I now get this error (see...
4
by: Emilio | last post by:
Question about Shared Sub Connect(server As , message As ) Why is in square brackets? Is it like Shared Sub Connect(server() As String, message() As String)
2
by: Tim_Mac | last post by:
hi, i have a tricky problem and my regex expertise has reached its limit. i have read other posts on this newsgroup that pull out the plain text from a html string, but that won't work for me...
5
by: Alan T | last post by:
string keywords; char charSeparators = new char { ' ' }; keywords = aKeywords.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); foreach (string keyword in keywords) {
9
by: Mark Berry | last post by:
Hi, How can I determine whether an object is derived from another object? My specific example is that I have a CustomError class with several specific error types that derive from it...
5
by: erictheone | last post by:
so here is my code. My getlines for the strings keyword and phrase at lines 44 and 79 respectively don't work. Please help!!! #include <cstdlib> #include <string> #include <iostream> #include...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.