Results 1 to 3 of 3

Thread: where i put these type of loop?

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    where i put these type of loop?

    i have these loop:

    Code:
    do
        'something......
        '.....................
        doevents
    loop
    what event, of usercontrol, i can implante these type of loop?
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: where i put these type of loop?

    That depends entirely on the purpose of the loop.

    What is it, or will it, be doing?

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    Re: where i put these type of loop?

    heres the entire loop:

    Code:
    Do
        If (blnActivateMoveNotMoveEvents = False And blnJoystickActivate = False) Then tmrNewEvents.Enabled = False
        If blnActivateMoveNotMoveEvents = True Then
            If (lngOldPosX < Extender.Left And lngOldPosY < Extender.Top) Then
                DirDirection = DirectionLeftUp
            ElseIf (lngOldPosX < Extender.Left And lngOldPosY > Extender.Top) Then
                DirDirection = DirectionLeftDown
            ElseIf (lngOldPosX > Extender.Left And lngOldPosY < Extender.Top) Then
                DirDirection = DirectionRightUp
            ElseIf (lngOldPosX > Extender.Left And lngOldPosY > Extender.Top) Then
                DirDirection = DirectionRightDown
            ElseIf (lngOldPosX < Extender.Left) Then
                DirDirection = DirectionLeft
            ElseIf (lngOldPosX > Extender.Left) Then
                DirDirection = DirectionRight
            ElseIf (lngOldPosY < Extender.Top) Then
                DirDirection = DirectionUp
            ElseIf (lngOldPosX > Extender.Top) Then
                DirDirection = DirectionLeftDown
            End If
            If Extender.Left <> lngOldPosX Or Extender.Top <> lngOldPosY Then
                lngOldPosX = Extender.Left
                lngOldPosY = Extender.Top
                RaiseEvent Move(lngOldPosX, lngOldPosY, DirDirection)
            Else
                RaiseEvent NotMove(lngOldPosX, lngOldPosY, DirDirection)
            End If
        End If
        If blnJoystickActivate = True Then
            Call PollJoystick
            If (MYJOYEX.dwXpos = 0 And MYJOYEX.dwYpos = 0) Then
                Direction = DirectionLeftUp
            ElseIf (MYJOYEX.dwXpos = 0 And MYJOYEX.dwYpos = 65535) Then
                Direction = DirectionLeftDown
            ElseIf (MYJOYEX.dwXpos = 65535 And MYJOYEX.dwYpos = 0) Then
                Direction = DirectionRightUp
            ElseIf (MYJOYEX.dwXpos = 65535 And MYJOYEX.dwYpos = 65535) Then
                Direction = DirectionRightDown
            ElseIf (MYJOYEX.dwXpos = 0) Then
                Direction = DirectionLeft
            ElseIf (MYJOYEX.dwXpos = 65535) Then
                Direction = DirectionRight
            ElseIf (MYJOYEX.dwYpos = 0) Then
                Direction = DirectionUp
            ElseIf (MYJOYEX.dwYpos = 65535) Then
                Direction = DirectionDown
            ElseIf (MYJOYEX.dwXpos = 0 And MYJOYEX.dwYpos = 0) Then
                Direction = DirectionNone
            End If
            RaiseEvent Joystick(JoyNum, Direction, lngButton)
        End If
        DoEvents
        Loop
    these loop can activate 3 events: joystick, move and notmove.
    insted of timer i wanted use these loop, but i don't know what usercontrol event that i can put these loop.
    in form i can put it in activate event and works, but here i don't know.
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

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