Skip to main content

Using multiple scripts

I have another question about scripting. I created a bunch of small scripts that check the dataset for repetition or missing information and so on. Afterwards I integrated some of the scripts into a different larger script, which runs about 3-5 of my initial small scripts. I called those integrated scripts "routines", which we will use to do a certain audit procedures from our audit plan.
As I create more and more smaller scripts I am in danger of losing track of where I integrated them into the routines.
Is there a way that I can make a change to one of my small scripts, which will automatically update all the other routines that my script is in?

Brian Element Fri, 10/26/2012 - 10:29

There is no way that I know of to make changes to a smaller script that will update the other scripts with the current IDEA tools.  One suggestion I might make is instead of integrating the smaller scripts into your larger script is that you call them from your main script, you have three options:

  1. Client.RunIDEAScript ( pathName As String ) this will simply run a script
  2. Client.RunIDEAScriptEx ( fileName As String, arg1 As Variant, arg2 As Variant, arg3 As Variant, arg4 As Variant ) in this script you can send up to 4 variables to the script
  3. Client.RunIDEAScriptRV ( scriptName As String, arg1 As Variant, arg2 As Variant, arg3 As Variant, arg4 As Variant ) this one will return 4 variables to the main script.

So by calling the scripts you can have several different small script all doing one thing and if you change one of them you don't have to worry about changing them in all the larger scripts.  Might be away to do what you wish to do.

CB Mon, 10/29/2012 - 04:07

hi the next example i will post in the section "Suggestions for IDEAScript snippets" will show you how to handle with the Client.RunIDEAScript function on a graphical interface..
with this interface you could mange your scripts...

otherwise i have also no other idea how to update your scripts within idea....

only way (with idea) is the suggestion to mange this with the Client.RunIDEAScriptxx function...


Helmer Fri, 09/01/2023 - 16:06

After trying to send and receive values from another script I finnally get it.
Here are the 2 scripts:
Sub Main
Dim MacroDir
MacroDir = CurDir & "\Macros.ILB\"
'seeting up the variables to be used.
Dim iNum1 As Variant
Dim iNum2 As Variant
Dim iNum3 As Variant
Dim iNum4 As Variant
iNum1 = "1"
iNum2 = "2"
iNum3 = "3"
iNum4 = "4"
MsgBox "MAIN SCRIPT" & Chr(13) & "Will Send to Sub Script: " & iNum1 & "-" & iNum2 & "-" & iNum3 & "-" & iNum4
Client.RunIDEAScriptRV MacroDir & "SubScript.iss", iNum1, iNum2, iNum3, iNum4
MsgBox "MAIN SCRIPT" & Chr(13) & "Received from Sub Script: " & iNum1 & "-" & iNum2 & "-" & iNum3 & "-" & iNum4
End Sub
Sub Main 
MsgBox "SUB SCRIPT" & Chr(13) & "Received from Main Script: " & arg1 & "-" & arg2 & "-" & arg3 & "-" & arg4
arg1 = Str(Val(arg1) + 10)
arg2 = Str(Val(arg2) + 10)
arg3 = Str(Val(arg3) + 10)
arg4 = Str(Val(arg4) + 10)
MsgBox "SUB SCRIPT" & Chr(13) & "Will send to Main Script: " & arg1 & "-" & arg2 & "-" & arg3 & "-" & arg4
End Sub