473,408 Members | 1,601 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,408 software developers and data experts.

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(stringreader) Like "*" & LCase(arDesigner(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 1481
al jones wrote:
I have the following line of code in a procedure (Function
SearchDesigner(ByVal stringreader As String) As String)

If LCase(stringreader) Like "*" & LCase(arDesigner(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 "stringreader"?

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(stringreader) Like "*" & LCase(arDesigner(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 "stringreader"?

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(stringreader) Like "*" & LCase(arDesigner(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 "stringreader"?

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
'TextFieldParser - 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
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...
5
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...
10
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? ...
13
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,...
10
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...
10
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...
3
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...
3
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...
2
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.