Hello everyone,
So I'm trying to come up with a script that will be running the same thing multiple times, with only one variable changing.
I want to do this as Subroutine but am unsure how to accomplish this.
Here is what I have so far:
There is a Main Script that calls into the Subroutine.
The Subroutine will be the same for each report I need, however, in each report I need it to call which "Division" it is doing like 10 or 11.
Is there a way I can have the subroutine pull the division number from a list or from somewhere?
I was trying to avoid having multiple subroutines just for that one changing variable, as there are hundreds of these reports I need to run.
'*****************************************************************************************************
' Set Variables
'*****************************************************************************************************
Dim V10 as String, V11 as String
V10 = 10
V11 = 11
SysHide "Timer"
EMConnect "A"
'*****************************************************************************************************
' Main Script
'*****************************************************************************************************
GoSub D10 'Configure Division 10 Report
GoSub D11 'Configure Division 11 Report
Exit Sub
'*****************************************************************************************************
' Divisions
'*****************************************************************************************************
D10:
GoSub DIV
Return
D11:
GoSub DIV
Return
*****************************************************************************************************
' Subroutine
'*****************************************************************************************************
DIV:
EMSendkey "14<ENTER>"
EMWaitX 1, RetC
EMSendkey "12<ENTER>"
EMWaitX 1, RetC
EMSendkey "7<ENTER>"
EMWaitX 1, RetC
EMSendkey "1"
EMWaitX 1, RetC
EMSendkey "1"
EMWaitX 1, RetC
EMSendkey *Insert Varibable(Division #) here*
EMWaitX 1, RetC
Return
*****************************************************************************************************
' End
'*****************************************************************************************************
As always, thank you in advance.
#Rumba