Re: Loop not working in VB.NET

Tech-Archive recommends: Fix windows errors by optimizing your registry



InStr is (if I remember correctly) case sensitive, so make sure everything
matches in upper/lower case.

Easiest way would be to convert all the "badwords" and the URL to
uppercase characters. I believe the command is .ToUpper (I don't have
vb on this machine)

Thanks,

Seth Rowe


Tim Patrick wrote:
InStr is (if I remember correctly) case sensitive, so make sure everything
matches in upper/lower case. Without seeing the code used to define and populate
BadWords(), it's hard to make guesses about what it contains.

-----
Tim Patrick
Start-to-Finish Visual Basic 2005

I am working on a project which tracks 'bad' words in IE and im using
a For loop to check for an array of words in he address bar. I have
included the broken code below. Any pointers on why it isnt working
would be very useful.

Private Sub BeginNavigate(ByVal pDisp As Object, ByRef URL As Object,
ByRef Flags As Object, ByRef TargetFrameName As Object, ByRef PostData
As Object, ByRef Headers As Object, ByRef Cancel As Boolean)
Dim i As Integer
For i = 0 To BadWords.Length - 1
If InStr(URL.ToString(), BadWords(i)) Then
IE.Quit()
End If
Next
End Sub
Thanks in advance


.



Relevant Pages

  • Re: Loop not working in VB.NET
    ... Without seeing the code used to define and populate BadWords(), it's hard to make guesses about what it contains. ... Private Sub BeginNavigate(ByVal pDisp As Object, ByRef URL As Object, ... ByRef Flags As Object, ByRef TargetFrameName As Object, ByRef PostData ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Magnify rectangle round mouse pointer
    ... > mouse pointer and magnifies that part of an image. ... Private Sub Picture1_MouseDown(ByRef Button As Integer, ... ByRef Shift As Integer, ByRef X As Single, ByRef Y As Single) ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Help on cropping an image
    ... Private Sub Form_Load' Set up UI ... ByRef Shift As Integer, ByRef X As Single, ByRef Y As Single) ... If (Button = vbLeftButton) Then ...
    (microsoft.public.vb.general.discussion)
  • Re: ByVal = ByRef
    ... In both cases, the is passed by-reference, and so ... when the is passed ByRef it additionally means ... the MsgBox will display: ... > Private Sub ChangeDOM ...
    (microsoft.public.vb.general.discussion)
  • Re: Pass object by value not working...
    ... Private classVar1 As String ... Property Get NumberAs String ... ByVal, not ByRef ... Private Sub AnotherSub ...
    (microsoft.public.excel.programming)