473,586 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question in re LIKE in VB 2005

I have the following line of code in a procedure (Function
SearchDesigner( ByVal stringreader As String) As String)

If LCase(stringrea der) Like "*" & LCase(arDesigne r(i, 0)) & "*" Then
return(designer (i,1))

I'm reading a line of text from a font file / extracting copyright
information from a font file (dependng on the type of font) then pass this
line of text to this function. I parse my way though an array which looke
like
designer(i,0) (designer(i,1)
(c) Character Character
by Character Character
© Characte Character
The first two seem to operate properly but the third seems to return true
in any case where the string 'character' is found as if the © symbol were
being ignored. The string 'Contains 5 character' matches '© Characte'
which is giving me many false positives, if this make sense to anyone,
could you offer a suggestion as to why it's occurring and how to make it
behave as I'd like.

//al
Sep 21 '06 #1
3 1484
al jones wrote:
I have the following line of code in a procedure (Function
SearchDesigner( ByVal stringreader As String) As String)

If LCase(stringrea der) Like "*" & LCase(arDesigne r(i, 0)) & "*" Then
return(designer (i,1))

I'm reading a line of text from a font file / extracting copyright
information from a font file (dependng on the type of font) then pass
this line of text to this function. I parse my way though an array
which looke like
designer(i,0) (designer(i,1)
>(c) Character Character
by Character Character
© Characte Character

The first two seem to operate properly but the third seems to return
true in any case where the string 'character' is found as if the ©
symbol were being ignored. The string 'Contains 5 character' matches
'© Characte' which is giving me many false positives, if this make
sense to anyone, could you offer a suggestion as to why it's
occurring and how to make it behave as I'd like.
It isn't clear to me exactly what you're trying to do. Where you've written
"Character" , is that meant to represent a single character, or is it sample
text?

Is designer(0,0)=" (c)" and designer(0,1)=" Character Character" or is
designer(0,0)=" (c) Character" and designer(0,1)=" Character"?

What is the relation of the variable arDesigner to the variable designer?

What values are you passing in for the value of the variable "stringread er"?

Would String.IndexOf be a better comparer for your purpose?

Andrew
Sep 21 '06 #2
On Thu, 21 Sep 2006 10:40:51 +0100, Andrew Morton wrote:
al jones wrote:
>I have the following line of code in a procedure (Function
SearchDesigner (ByVal stringreader As String) As String)

If LCase(stringrea der) Like "*" & LCase(arDesigne r(i, 0)) & "*" Then
return(designe r(i,1))

I'm reading a line of text from a font file / extracting copyright
information from a font file (dependng on the type of font) then pass
this line of text to this function. I parse my way though an array
which looke like
designer(i,0) (designer(i,1)
>>(c) Character Character
by Character Character
© Characte Character

The first two seem to operate properly but the third seems to return
true in any case where the string 'character' is found as if the ©
symbol were being ignored. The string 'Contains 5 character' matches
'© Characte' which is giving me many false positives, if this make
sense to anyone, could you offer a suggestion as to why it's
occurring and how to make it behave as I'd like.

It isn't clear to me exactly what you're trying to do. Where you've written
"Character" , is that meant to represent a single character, or is it sample
text?

Is designer(0,0)=" (c)" and designer(0,1)=" Character Character" or is
designer(0,0)=" (c) Character" and designer(0,1)=" Character"?

What is the relation of the variable arDesigner to the variable designer?

What values are you passing in for the value of the variable "stringread er"?

Would String.IndexOf be a better comparer for your purpose?

Andrew
Anton, scratch this - it's not this part of the program that's the problem
- after a little further examination it's when I load the array from a file
that the copyright symbol (and others outside the ascii range, it appears)
are being dropped.

BTW, that was confusing - but Character is a font designer - so it's his
name, not a 'symbol'

I'll post a different question as soon as the coffee's ready. //al
Sep 21 '06 #3
On Thu, 21 Sep 2006 10:40:51 +0100, Andrew Morton wrote:
al jones wrote:
>I have the following line of code in a procedure (Function
SearchDesigner (ByVal stringreader As String) As String)

If LCase(stringrea der) Like "*" & LCase(arDesigne r(i, 0)) & "*" Then
return(designe r(i,1))

I'm reading a line of text from a font file / extracting copyright
information from a font file (dependng on the type of font) then pass
this line of text to this function. I parse my way though an array
which looke like
designer(i,0) (designer(i,1)
>>(c) Character Character
by Character Character
© Characte Character

The first two seem to operate properly but the third seems to return
true in any case where the string 'character' is found as if the ©
symbol were being ignored. The string 'Contains 5 character' matches
'© Characte' which is giving me many false positives, if this make
sense to anyone, could you offer a suggestion as to why it's
occurring and how to make it behave as I'd like.

It isn't clear to me exactly what you're trying to do. Where you've written
"Character" , is that meant to represent a single character, or is it sample
text?

Is designer(0,0)=" (c)" and designer(0,1)=" Character Character" or is
designer(0,0)=" (c) Character" and designer(0,1)=" Character"?

What is the relation of the variable arDesigner to the variable designer?

What values are you passing in for the value of the variable "stringread er"?

Would String.IndexOf be a better comparer for your purpose?

Andrew
If you'd consider looking for me, I've corrected the problem statement in
'TextFieldParse r - reading tab delimited file' TextFieldParser is dropping
some letters from the text it's reading. French diacriticals, German
umlauted and copyright symbols that I can identify at the moment.

Again, thanks for looking //al
Sep 21 '06 #4

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

Similar topics

6
1358
by: ben3003 | last post by:
I am only asking for my code to do a simple thing but for some reason i just can't get it to do what i want it to do... it been bugging me all day! The user inputs 2 dates on one page. in the form xx/xx/xxxx I then want the output page to display the amount of days that there are between these two dates, inclusive. For example: ...
5
2128
by: Richard P | last post by:
I need some help on timers. My app is asp.net 1.1 website running in a shared hosting environment with a third-party service provider. I currently request and cache 20 - 40 remote RSS feeds. When a user requests the page, the app first tries to retrieve a feed from cache, if the feed has expired, it goes off and request the file from the web....
10
1630
by: Geoff Cox | last post by:
Hello, Would appreciate a little help here! How do I refer to multiple elements with IDs such as question1, question2, question3 etc, in following? document.getElementById('question').innerHTML I want to use
13
2167
by: Elaine | last post by:
This has to do with self-joins and includes a running balance problem. Is it possible to do this using SQL alone? Amortization schedule -------------------------- Givens: beginning balance, payment amount, # of periods, rate per period schedule would consist of columns for balance, principal paid,
10
3432
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read somewhere that each folder under the "web site" is compiled in separate assembly. I however, did not find that the "web site" creation in vs.net...
10
3701
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server Error in '/QuickStartv20' Application. -------------------------------------------------------------------------------- Configuration Error...
3
3030
by: Learner | last post by:
Hi there, I have one another question on VSS 2005 and VS 2003. We had few projects built in VS 2003 and we had all of those projects under the VSS 6.0 until now. But as part of our development environment up gradation our idea is slowly move few projects from VSS 6.0 to VSS 2005. As a test we did move an ASP.NET project that was built in...
3
1380
by: barry | last post by:
I had Visual Web Developer Express 2005 and Visual Studio 2005 installed on my computer. Realizing that I did not need Visual Web Developer Express 2005 since I had VS 2005 I removed it. My question could this be a possible reason that the ASP.NET configuration tool is not working in VS 2005 when I am doing web development? What happens is...
2
1380
by: ewingate | last post by:
I am currently going through an MCAD/MCSD training guide for Exam# 70-316. It is a great book but it shows it's age with certain subjects. The chapter on databinding is one of these. This somewhat wordy introduction is because I actually have 2 questions. The first one concerns SQL. My training guide has me bringing up the Northwind sample DB...
0
7915
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8204
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. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
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...
0
6617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3838
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...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1184
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.