Using multiple scripts

6 posts / 0 new
Last post
SREN
Offline
Joined: 10/25/2012 - 04:22
Using multiple scripts

Hi,
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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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's picture
CB
Offline
Joined: 10/19/2012 - 04:54

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...

cheers,
chris

FGS-Digital
Offline
Joined: 11/18/2022 - 04:53

how does the 2nd script file have to look? It is nowhere to be found in the documentation afaics :/

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi FGS-Digital, what are you looking for.  This post is 10 years old so I don't think the original posters are around anymore.

Helmer
Offline
Joined: 08/30/2023 - 19:35

Hi!
After trying to send and receive values from another script I finnally get it.
Here are the 2 scripts:
 
MainScript.iss
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
 
SubScript.iss
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