Results 1 to 4 of 4

Thread: What am I doing wrong?

  1. #1

    Thread Starter
    Addicted Member macuiare's Avatar
    Join Date
    Jan 2009
    Posts
    229

    What am I doing wrong?

    Hey, I'm trying to Get my program to exit when it detects a string has been typed. I have a low level keyboard hook adding the key info to a string called logged which gets cleard every so often but a timer runs for ever looking if that string contains one of the exit codes

    Code:
            Do Until i = maxcount
                If MasterArray(i) = Nothing Then
                Else
                    Dim data() As String = MasterArray(i).Split(":"c)
                    If logged.Contains((data(0))) Then
                        MsgBox("Typed Keyword")
                        logged = ""
                        Me.Close()
    
                    Else
                        i = i + 1
                    End If
                End If
            Loop
    I get thrown no errors just the program hits not responding,

    If anyone can help me out i'd appreciate it

    thankyou

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: What am I doing wrong?

    Me.Close doesn't mean that the loop will stop.

    Try:
    Code:
    Me.Close
    Return
    This of course will work only if you see MsgBox (your logged variable contain what it should contain).

  3. #3

    Thread Starter
    Addicted Member macuiare's Avatar
    Join Date
    Jan 2009
    Posts
    229

    Re: What am I doing wrong?

    Same problem still freezing up. I tried Exit do aswell but same effect. D:

  4. #4
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: What am I doing wrong?

    Does the MsgBox appear? If not, then the problem is not here.

    Either MasterArray is nothing or your logged variable does not contain data(0). Check this using watches or in the break mode.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width