OutOfStep
Member
I am trying to create a macro "loop" in JDE World 8.1. What I am starting with is a list of item numbers in Microsoft Excel. I am copying the entire list (could be anywhere from 500 to 5000 numbers) at once, then doing a paste/paste next/paste next/paste next/etc into a label-printing program in JDE. I am trying to build a macro that has the keystroke combination of Paste Next - Enter - End recorded once, then write a "loop" function afterwards so I can loop the keystroke combination a specified number of times. Here are the keystrokes I have recorded (in VBScript format):
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)
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
----------------------------
Does anyone know exactly what code I would need to add to the end of this to loop this subroutine? I have named it "PasteNext," as you can see. My goal is to be able to tell it something like:
Loop "PasteNext" X number of times
Where X is a variable I can change, depending on how many labels I need to print in that particular run. I have tried the "For...Next" looping statement, but can't seem to get it to work.
Any VBScript gurus that can help me out with this?
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)
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
----------------------------
Does anyone know exactly what code I would need to add to the end of this to loop this subroutine? I have named it "PasteNext," as you can see. My goal is to be able to tell it something like:
Loop "PasteNext" X number of times
Where X is a variable I can change, depending on how many labels I need to print in that particular run. I have tried the "For...Next" looping statement, but can't seem to get it to work.
Any VBScript gurus that can help me out with this?