Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do ... While Loop not working ?! 1

Status
Not open for further replies.

sucoyant

IS-IT--Management
Sep 21, 2002
213
US
Good day!

ugh, I'm pulling my hair out on this one.
Instead of quitting after 10 tries, my application just freezes, and I have to give it the 3 finger salute. Please take a look at my code.
Why dosen't it quit after 10 tries?


Code:
Public Sub goNext(scrCheck As String, amtToCheck, Optional colPos)
Dim myCounter As Integer

nextScreenValid = ""
goNextScreen = ""

myCounter = 1
Do
    nextScreenValid = scrCheck
    
    If IsMissing(colPos) Then
        goNextScreen = Sess0.Screen.GetString(1, 1, amtToCheck)
    Else
        goNextScreen = Sess0.Screen.GetString(1, colPos, amtToCheck)
    End If
    
    myCounter = myCounter + 1
Loop While goNextScreen <> nextScreenValid Or myCounter = 10



End Sub


Any ideas? It would be much appreciated!

________________________________________
BUDDHA.gif
Buddha. Dharma. Sangha.
 
Try this:
Loop While goNextScreen <> nextScreenValid And myCounter < 10

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
PHV to the rescue... AGAIN!

You are amazing.

Thanks again PHV.


________________________________________
BUDDHA.gif
Buddha. Dharma. Sangha.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top