473,721 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there any command in vb.net like the Inlist function of foxpro?

kd
Hi All,

I found the 'Inlist' function of foxpro very useful.

Is there any command in vb.net that does the same job?

Thanks.
kd
Nov 21 '05 #1
6 6868
"kd" <kd@discussions .microsoft.com> schrieb:
I found the 'Inlist' function of foxpro very useful.

Is there any command in vb.net that does the same job?


Jay B. Harlow [MVP - Outlook] posted a solution for strings some days ago:

<URL:http://groups.google.d e/groups?selm=emu GXgdGFHA.1500%4 0TK2MSFTNGP09.p hx.gbl>

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

Nov 21 '05 #2
Kd,
In addition to Herfried's link, I would suggest you review the "Complete
Thread" link in the header (of Herfried's link), as my other post in that
thread provided a number of alternatives.

Hope this helps
Jay

"kd" <kd@discussions .microsoft.com> wrote in message
news:8F******** *************** ***********@mic rosoft.com...
Hi All,

I found the 'Inlist' function of foxpro very useful.

Is there any command in vb.net that does the same job?

Thanks.
kd

Nov 21 '05 #3
kd
Jay,

Reading through the complete thread has been helpful. Thanks.

I have one question; may sound elementary though.

What does this pattern mean to vb.net?
Dim pattern As String = "(^|\W+)(" & String.Join("|" , words) &
")($|\W+)"

At runtime, pattern would hold the value
(^|\W+)(cat|dog |sleep)($|\W+)
which is passed to
System.Text.Reg ularExpressions .Regex.IsMatch
How does this pattern convey to IsMatch to look for whole words, instead of
searching for a part of the pattern? Does the pattern convey to Ismatch that
“|” is a delimiter?

Regards,
kd.
"Jay B. Harlow [MVP - Outlook]" wrote:
Kd,
In addition to Herfried's link, I would suggest you review the "Complete
Thread" link in the header (of Herfried's link), as my other post in that
thread provided a number of alternatives.

Hope this helps
Jay

"kd" <kd@discussions .microsoft.com> wrote in message
news:8F******** *************** ***********@mic rosoft.com...
Hi All,

I found the 'Inlist' function of foxpro very useful.

Is there any command in vb.net that does the same job?

Thanks.
kd


Nov 21 '05 #4
kd,
What does this pattern mean to vb.net? The pattern itself is a special language the RegEx understands. It has a
number of operators that mean special things.

For example:
| is alternation
() are grouping
$ is end of line
^ is beginning of line
+ is one or more
\W is non-word characters
...

For a complete list & meanings of all the operators see the reference &
documentation links below.

NOTE: Rather then Dim pattern As String = "(^|\W+)(" & String.Join("|" , words) &
")($|\W+)"
It appears you can reduce the expression to
Dim pattern As String = "(" & String.Join("|" , words) & ")\b"
The \b specifies that the match must occur on a boundary between \w
(alphanumeric) & \W (nonalhpanumeri c) characters.

The "Easiest" way to find out what it means is to use the Analyzer button in
Expresso or the Interpret button in RegEx Workbench (links below).

It says that it needs match the begging of the string or white space,
followed by one of the words, followed by end of the string or white space.
The begin or end of string can be a new line based on the options passed to
RegEx.

Expresso & RegEx Workbench both have wizards of varying degrees to help you
build your expression, plus they allow you to test your expressions, also
the analyzer/interpreter in each is rather handy.

Expresso:
http://www.ultrapico.com/Expresso.htm

RegEx Workbench:
http://www.gotdotnet.com/Community/U...-4ee2729d7322A

tutorial & reference on using regular expressions:
http://www.regular-expressions.info/

The MSDN's documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp

Hope this helps
Jay

"kd" <kd@discussions .microsoft.com> wrote in message
news:2A******** *************** ***********@mic rosoft.com... Jay,

Reading through the complete thread has been helpful. Thanks.

I have one question; may sound elementary though.

What does this pattern mean to vb.net?
Dim pattern As String = "(^|\W+)(" & String.Join("|" , words) &
")($|\W+)"

At runtime, pattern would hold the value
(^|\W+)(cat|dog |sleep)($|\W+)
which is passed to
System.Text.Reg ularExpressions .Regex.IsMatch
How does this pattern convey to IsMatch to look for whole words, instead
of
searching for a part of the pattern? Does the pattern convey to Ismatch
that
"|" is a delimiter?

Regards,
kd.
"Jay B. Harlow [MVP - Outlook]" wrote:
Kd,
In addition to Herfried's link, I would suggest you review the "Complete
Thread" link in the header (of Herfried's link), as my other post in that
thread provided a number of alternatives.

Hope this helps
Jay

"kd" <kd@discussions .microsoft.com> wrote in message
news:8F******** *************** ***********@mic rosoft.com...
> Hi All,
>
> I found the 'Inlist' function of foxpro very useful.
>
> Is there any command in vb.net that does the same job?
>
> Thanks.
> kd


Nov 21 '05 #5
kd,
What does this pattern mean to vb.net? The pattern itself is a special language the RegEx understands. It has a
number of operators that mean special things.

For example:
| is alternation
() are grouping
$ is end of line
^ is beginning of line
+ is one or more
\W is non-word characters
...

For a complete list & meanings of all the operators see the reference &
documentation links below.

NOTE: Rather then Dim pattern As String = "(^|\W+)(" & String.Join("|" , words) &
")($|\W+)"
It appears you can reduce the expression to
Dim pattern As String = "(" & String.Join("|" , words) & ")\b"
The \b specifies that the match must occur on a boundary between \w
(alphanumeric) & \W (nonalhpanumeri c) characters.

The "Easiest" way to find out what it means is to use the Analyzer button in
Expresso or the Interpret button in RegEx Workbench (links below).

It says that it needs match the begging of the string or white space,
followed by one of the words, followed by end of the string or white space.
The begin or end of string can be a new line based on the options passed to
RegEx.

Expresso & RegEx Workbench both have wizards of varying degrees to help you
build your expression, plus they allow you to test your expressions, also
the analyzer/interpreter in each is rather handy.

Expresso:
http://www.ultrapico.com/Expresso.htm

RegEx Workbench:
http://www.gotdotnet.com/Community/U...-4ee2729d7322A

tutorial & reference on using regular expressions:
http://www.regular-expressions.info/

The MSDN's documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp

Hope this helps
Jay

"kd" <kd@discussions .microsoft.com> wrote in message
news:2A******** *************** ***********@mic rosoft.com... Jay,

Reading through the complete thread has been helpful. Thanks.

I have one question; may sound elementary though.

What does this pattern mean to vb.net?
Dim pattern As String = "(^|\W+)(" & String.Join("|" , words) &
")($|\W+)"

At runtime, pattern would hold the value
(^|\W+)(cat|dog |sleep)($|\W+)
which is passed to
System.Text.Reg ularExpressions .Regex.IsMatch
How does this pattern convey to IsMatch to look for whole words, instead
of
searching for a part of the pattern? Does the pattern convey to Ismatch
that
"|" is a delimiter?

Regards,
kd.
"Jay B. Harlow [MVP - Outlook]" wrote:
Kd,
In addition to Herfried's link, I would suggest you review the "Complete
Thread" link in the header (of Herfried's link), as my other post in that
thread provided a number of alternatives.

Hope this helps
Jay

"kd" <kd@discussions .microsoft.com> wrote in message
news:8F******** *************** ***********@mic rosoft.com...
> Hi All,
>
> I found the 'Inlist' function of foxpro very useful.
>
> Is there any command in vb.net that does the same job?
>
> Thanks.
> kd


Nov 21 '05 #6
kd
Thanks Jay for the great explanation.

Regards,
kd.

"Jay B. Harlow [MVP - Outlook]" wrote:
kd,
What does this pattern mean to vb.net?

The pattern itself is a special language the RegEx understands. It has a
number of operators that mean special things.

For example:
| is alternation
() are grouping
$ is end of line
^ is beginning of line
+ is one or more
\W is non-word characters
...

For a complete list & meanings of all the operators see the reference &
documentation links below.

NOTE: Rather then
Dim pattern As String = "(^|\W+)(" & String.Join("|" , words) &
")($|\W+)"


It appears you can reduce the expression to
Dim pattern As String = "(" & String.Join("|" , words) & ")\b"


The \b specifies that the match must occur on a boundary between \w
(alphanumeric) & \W (nonalhpanumeri c) characters.

The "Easiest" way to find out what it means is to use the Analyzer button in
Expresso or the Interpret button in RegEx Workbench (links below).

It says that it needs match the begging of the string or white space,
followed by one of the words, followed by end of the string or white space.
The begin or end of string can be a new line based on the options passed to
RegEx.

Expresso & RegEx Workbench both have wizards of varying degrees to help you
build your expression, plus they allow you to test your expressions, also
the analyzer/interpreter in each is rather handy.

Expresso:
http://www.ultrapico.com/Expresso.htm

RegEx Workbench:
http://www.gotdotnet.com/Community/U...-4ee2729d7322A

tutorial & reference on using regular expressions:
http://www.regular-expressions.info/

The MSDN's documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp

Hope this helps
Jay

"kd" <kd@discussions .microsoft.com> wrote in message
news:2A******** *************** ***********@mic rosoft.com...
Jay,

Reading through the complete thread has been helpful. Thanks.

I have one question; may sound elementary though.

What does this pattern mean to vb.net?
Dim pattern As String = "(^|\W+)(" & String.Join("|" , words) &
")($|\W+)"

At runtime, pattern would hold the value
(^|\W+)(cat|dog |sleep)($|\W+)
which is passed to
System.Text.Reg ularExpressions .Regex.IsMatch
How does this pattern convey to IsMatch to look for whole words, instead
of
searching for a part of the pattern? Does the pattern convey to Ismatch
that
"|" is a delimiter?

Regards,
kd.
"Jay B. Harlow [MVP - Outlook]" wrote:
Kd,
In addition to Herfried's link, I would suggest you review the "Complete
Thread" link in the header (of Herfried's link), as my other post in that
thread provided a number of alternatives.

Hope this helps
Jay

"kd" <kd@discussions .microsoft.com> wrote in message
news:8F******** *************** ***********@mic rosoft.com...
> Hi All,
>
> I found the 'Inlist' function of foxpro very useful.
>
> Is there any command in vb.net that does the same job?
>
> Thanks.
> kd


Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4052
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: oIE.Document.Forms("searchform").Item(<name>).Value = <myvalue> But I cannot control a dropdown with an onchange event. I can set the dropdown's value and selectedIndex, but then calling the onChange() or Click() does not do anything. It only seems to fire the onchange if I
13
13345
by: Simon Bailey | last post by:
I am a newcomer to databases and am not sure which DBMS to use. I have a very simplified knowledge of databases overall. I would very much appreciate a (simplifed) message explaining the advantages and disadvantages of both programs. Many Thanks Simon
8
2716
by: Alfred | last post by:
Hi What is the difference between Access and Foxpro and who will use Foxpro. Thanks Alfred
1
3932
by: GPBSOFT | last post by:
I am Italian developer, escuse me for my bad English I have a problem with ODBC. I must link to a database from Visual FoxPro, I have installed Windows XP Professional with service pack 2. When I try to install driver for Visual FoxPro i see the message: “Error 1918. Error installing ODBC driver: Microsoft Visual FoxPro Driver, ODBC error 13: : Impossibile caricare la libreria di impostazione o del convertitore. Verify that the file...
2
2531
by: Amedee Van Gasse | last post by:
Hello, Since it is the first time I'm posting in these groups, I believe a (short) introduction of myself would not be a bad thing. I am mainly a support engineer, not a programmer. I do have some experience with Java and LAMP (Linux/Apache/MySQL/PHP) but don't consider me one of those boring OS advocates please. ;-) I also have done a little bit with Visual Basic (and GwBasic in a long forgotten past) and nowadays my job involves...
5
15577
by: ABC | last post by:
Is there any function in C# to do as: result true if InList('abc,ihjl,dkfd,ooo', 'abc');
2
2167
by: Toco | last post by:
Hello. I have app written in C# that we are testing. The executable is shared on our network. The method we are testing is a call to a foxpro table. The call is made to query the table, then fill a datable with the resultset. All is fine when I run the executable from my machine. However, when our test user runsthe same executable, the app errors out when attempting to read from the foxpro table. I have logged where the user...
4
8451
by: Robert Hooker | last post by:
I have installed our .NET application on a system running Microsoft Windows Vista operating system. When I run our application, I receive the following error message whenever it tries to create a DBF file using VFPODBC: "ERROR Driver does not support this function" I am using a connection string that I have used for many years with no problems, here is some sample C# code:
7
5492
by: z71mdridin | last post by:
I have an asp.net website that uses Form authentication to authenticate users. I need to provide users with a report based on FoxPro data that resides on a remote server. When I attempt to connect to the Foxpro directory by using the ODBC DSN that we currently use in ColdFusion, I get the following message: ERROR File 'table.dbf' does not exist. I know this is probably a permissions issue because asp.net is being
0
8853
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8736
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9146
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6677
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.