Code in Visual Basic

20 pts.
Tags:
Visual Basic 2005
Visual Basic array
Code: Function SearchDesigner(ByVal strString As String) As String 'Dim errMsg As String Dim i As Integer Dim strstrString As String = strString.ToLower If Len(strString) = 0 Then Return "" For i = UBound(arDesigner) - 1 To 0 Step -1 Try If strstrString Like "*" & arDesigner(i, 0) & "*" Then arDesignerCounter(i) += 1 Return arDesigner(i, 1) End If Catch e As ArgumentException 'errMsg = String.Format("Line {0} {1} " & vbLf & "Contains an invalid pattern and will be skipped.", i, arDesigner(i, 0)) 'MessageBox.Show(errMsg, "Pattern Error", MessageBoxButtons.OK, MessageBoxIcon.Information) End Try Next Return "" End Function I've just parsed my way through 225,000 font files. Most of the time this works as I expect but upon occasion (1,500 more or less out of the 225,000 files) it doesn't. For example: strString = "(c) daisuke sugisawa001.00'" The array I'm parsing through, in part, looks like: Quote: DadoQueiroz Dado Queiroz Daisuke Monma Daisuke Monma daisuke sugisawa Daisuke Sugisawa Dale R. Kramer Dale R Kramer dale schumacher Dale Schumacher It should have been true only on the middle line, since nothing that I can see matches til that point. and the last three lines of the array look like: Quote: Typographer?s Edition (93) Typographers Edition (93) Typographer?s Edition (93) Typographers Edition (93) Typographer?s Edition (94) Typographers Edition (94) Like is returning true ( a match ) on the last line ... and I can't see why. Anyone?

Software/Hardware used:
Windows 7
ASKED: November 6, 2012  7:11 PM
UPDATED: November 6, 2012  7:20 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Sorry, this is assinine; I’ve tried to correct the “returns” and the editor jut ignores them.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    The editor is indeed having problems. A workaround is to post code to http://pastebin.com and to post the link back here. -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following