I am new to VBScript and could use some help. I am trying to create a macro "loop" in JD Edwards World 8.1, which gives me the option to record in VBScript. I have recorded the keystrokes for "Paste Next / Enter / End" in a VBScript format. What I am trying to do now is add a statement at the end that will loop that series of keystrokes a specified number of times. Here is the VBScript that I have for the keystrokes:
REM This line calls the macro subroutine
PasteNext
sub PasteNext()
autECLSession.autECLOIA.WaitForAppAvailable
autECLMacro "[edit-paste-next]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
autECLSession.autECLPS.WaitForAttrib 5,29,"00","3c",3,10000
autECLSession.autECLPS.WaitForCursor 5,30,10000
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[eraseeof]"
end sub
------------------------------------------------------
I have experimented with the "For...Next" looping statement, but I can't get it to work properly. I would like to add something to the end of this that basically tells it to "repeat this subroutine X number of times," where I could go in and change the value of X as needed.
Any VBScript gurus out there that can show me what I need to add to accomplish this? Any help is greatly appreciated.
REM This line calls the macro subroutine
PasteNext
sub PasteNext()
autECLSession.autECLOIA.WaitForAppAvailable
autECLMacro "[edit-paste-next]"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
autECLSession.autECLPS.WaitForAttrib 5,29,"00","3c",3,10000
autECLSession.autECLPS.WaitForCursor 5,30,10000
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[eraseeof]"
end sub
------------------------------------------------------
I have experimented with the "For...Next" looping statement, but I can't get it to work properly. I would like to add something to the end of this that basically tells it to "repeat this subroutine X number of times," where I could go in and change the value of X as needed.
Any VBScript gurus out there that can show me what I need to add to accomplish this? Any help is greatly appreciated.