Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2015
    Posts
    1

    Unanswered: Code Will not recognize 2nd IF statement

    At the very end of this code I'm requesting that PF8 is selected if this wording appears "<ENTER> DESIRED ACTION CODE ..." and if this wording appears "END OF RECORD REACHED" then select PF3. The code recognizes the first if statement, but not the second one. I've tried to insert If and Else statements, but get errors.

    While oScreen.GetString(Row9, 12, 1) <> " "



    Sheet4.Cells(xlRow2, "B").value = Trim(oScreen.GetString(4, 19, 8)) ' Sender ID
    Sheet4.Cells(xlRow2, "C").value = Trim(oScreen.GetString(Row9, 11, 8)) ' Receiving Application
    Sheet4.Cells(xlRow2, "D").value = Trim(oScreen.GetString(Row9, 22, 9)) ' Recv Date
    Sheet4.Cells(xlRow2, "E").value = Trim(oScreen.GetString(Row9, 31, 9)) ' Recv Time
    Sheet4.Cells(xlRow2, "F").value = Trim(oScreen.GetString(Row9, 40, 9)) ' Job Name
    Sheet4.Cells(xlRow2, "G").value = Trim(oScreen.GetString(Row9, 51, 9)) ' Status


    oScreen.MoveTo Row9, 5, 1

    oScreen.SendKeys ("B" & "<Enter>")

    While Not oScreen.WaitHostQuiet(250)
    '-- do nothing
    Wend

    Sheet4.Cells(xlRow2, "H").value = Trim(oScreen.GetString(18, 27, 12)) ' Sending Info Invoice Amount
    Sheet4.Cells(xlRow2, "I").value = Trim(oScreen.GetString(18, 65, 12)) ' Receiving Info Invoice Amount

    oScreen.SendKeys ("<PF3>")

    While Not oScreen.WaitHostQuiet(250)
    '-- do nothing
    Wend

    If InStr(1, UCase(oScreen.GetString(24, 1, 75)), "<ENTER> DESIRED ACTION CODE ...") > 0 Then oScreen.SendKeys ("<PF8>")



    If InStr(1, UCase(oScreen.GetString(24, 1, 75)), "END OF RECORD REACHED") > 0 Then oScreen.SendKeys ("<PF3>")

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    If InStr(1, UCase(oScreen.GetString(24, 1, 75)), "<ENTER> DESIRED ACTION CODE ...") > 0 Then
        oScreen.SendKeys ("<PF8>")
    Else If InStr(1, UCase(oScreen.GetString(24, 1, 75)), "END OF RECORD REACHED") > 0 Then
        oScreen.SendKeys ("<PF3>")
    End If
    ?
    George
    Home | Blog

  3. #3
    Join Date
    May 2014
    Posts
    24
    I am confused with your code. There must be something wrong in your sequence or statement.

Tags for this Thread

Posting Permissions

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