I have the below code where there is two While statements the while statement for Input 2 gets looped and then macro gets done, without looping the the while statement for input 1 please advice in this
'--------------------------------------------------------------------------------
' This macro was created by the Macro Recorder.
' Session Document: "SESSION1.EDP"
' Date: Tuesday, August 21, 2012 22:15:53
' User:
'--------------------------------------------------------------------------------
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object. Stopping macro playback."
STOP
End If
Set Sessions = System.Sessions
If (Sessions is Nothing) Then
Msgbox "Could not create the Sessions collection object. Stopping macro playback."
STOP
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 3000 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 is Nothing) Then
Msgbox "Could not create the Session object. Stopping macro playback."
STOP
End If
If Not Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
' This section of code contains the recorded events
close
Open "C:\Users\bzxllh\Desktop\New.txt" For Input As #1
Open "C:\Users\bzxllh\Desktop\Part.txt" For Input As #2
'Open "C:\Efiles\Delete\Out Delete.txt" For Output As #2
'Label:
'Input #1, FEWO
'Input #1, Eg1
'Input #1, Eg2
'Input #1, Eg3
'Input #1, Eg4
End_Of_File = Eof(1)
While End_Of_File = 0
Input #1, En
End_Of_Fil = Eof(2)
while End_Of_Fil = 0
Input #2, Pa
Sess0.Screen.MoveTo 04,02
Sess0.Screen.Sendkeys(En &"<tab><EraseEOF><tab><EraseEOF>")
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.MoveTo 04,47
Sess0.Screen.Sendkeys(Pa)
'Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<NewLine><NewLine>s<Pf5>")
Sess0.Screen.WaitHostQuiet(100)
NUB = Sess0.Screen.GetString (11, 36, 1)
if NUB = "U" then
Sess0.Screen.WaitHostQuiet(100)
NUE = Sess0.Screen.GetString (13, 17, 4)
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<NewLine>c<NewLine><NewLine><Tab><Tab><Tab>p<NewLine>gcgzk<EraseEOF>")
If NUE= "WFUO" then
Sess0.Screen.MoveTo 07,03
Sess0.Screen.Sendkeys("c")
Sess0.Screen.MoveTo 13,17
Sess0.Screen.Sendkeys("<EraseEOF>SOP<Tab><Tab><Tab><EraseEOF>")
End If
Sess0.Screen.Sendkeys("<Enter>")
End if
'Sess0.Screen.Sendkeys("<NewLine>c<NewLine><NewLine><Tab><Tab><Tab>p<NewLine>gcgzk<EraseEOF><Enter>")
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<Pf5>")
Sess0.Screen.WaitHostQuiet(100)
System.TimeoutValue = OldSystemTimeout
Sess0.Screen.WaitHostQuiet(100)
End_Of_Fil = Eof(2)
Wend
End_Of_File = Eof(1)
wend
MsgBox "Macro completed", 0
End Sub
'--------------------------------------------------------------------------------
' This macro was created by the Macro Recorder.
' Session Document: "SESSION1.EDP"
' Date: Tuesday, August 21, 2012 22:15:53
' User:
'--------------------------------------------------------------------------------
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object. Stopping macro playback."
STOP
End If
Set Sessions = System.Sessions
If (Sessions is Nothing) Then
Msgbox "Could not create the Sessions collection object. Stopping macro playback."
STOP
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 3000 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 is Nothing) Then
Msgbox "Could not create the Session object. Stopping macro playback."
STOP
End If
If Not Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
' This section of code contains the recorded events
close
Open "C:\Users\bzxllh\Desktop\New.txt" For Input As #1
Open "C:\Users\bzxllh\Desktop\Part.txt" For Input As #2
'Open "C:\Efiles\Delete\Out Delete.txt" For Output As #2
'Label:
'Input #1, FEWO
'Input #1, Eg1
'Input #1, Eg2
'Input #1, Eg3
'Input #1, Eg4
End_Of_File = Eof(1)
While End_Of_File = 0
Input #1, En
End_Of_Fil = Eof(2)
while End_Of_Fil = 0
Input #2, Pa
Sess0.Screen.MoveTo 04,02
Sess0.Screen.Sendkeys(En &"<tab><EraseEOF><tab><EraseEOF>")
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.MoveTo 04,47
Sess0.Screen.Sendkeys(Pa)
'Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<NewLine><NewLine>s<Pf5>")
Sess0.Screen.WaitHostQuiet(100)
NUB = Sess0.Screen.GetString (11, 36, 1)
if NUB = "U" then
Sess0.Screen.WaitHostQuiet(100)
NUE = Sess0.Screen.GetString (13, 17, 4)
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<NewLine>c<NewLine><NewLine><Tab><Tab><Tab>p<NewLine>gcgzk<EraseEOF>")
If NUE= "WFUO" then
Sess0.Screen.MoveTo 07,03
Sess0.Screen.Sendkeys("c")
Sess0.Screen.MoveTo 13,17
Sess0.Screen.Sendkeys("<EraseEOF>SOP<Tab><Tab><Tab><EraseEOF>")
End If
Sess0.Screen.Sendkeys("<Enter>")
End if
'Sess0.Screen.Sendkeys("<NewLine>c<NewLine><NewLine><Tab><Tab><Tab>p<NewLine>gcgzk<EraseEOF><Enter>")
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(100)
Sess0.Screen.Sendkeys("<Pf5>")
Sess0.Screen.WaitHostQuiet(100)
System.TimeoutValue = OldSystemTimeout
Sess0.Screen.WaitHostQuiet(100)
End_Of_Fil = Eof(2)
Wend
End_Of_File = Eof(1)
wend
MsgBox "Macro completed", 0
End Sub