I have couple of subroutines that are actively used in my 10 other scripts. currently I have copied the subroutine into all my 10 scripts. Is there a way if I have macro script -1 that has SRT1, how can I call this SRT1 from macro script 2, macro 3 etc?
Thanks
how to call subroutine from another
Moderators: Dorian (MJT support), JRL
Put each subroutine that you want to share between scripts into it's own separate file.
Example:
c:\srt2.scp
---------------------------
SRT>mySub2
... code goes here
... more code
END>mySub2
Then from macroscript1
SRT>Sub1
END>Sub1
Include>c:\srt2.scp
SRT>Sub3
END>Sub3
Then from macroscript2
Include>c:\srt2.scp
SRT>Sub4
END>Sub4
Example:
c:\srt2.scp
---------------------------
SRT>mySub2
... code goes here
... more code
END>mySub2
Then from macroscript1
SRT>Sub1
END>Sub1
Include>c:\srt2.scp
SRT>Sub3
END>Sub3
Then from macroscript2
Include>c:\srt2.scp
SRT>Sub4
END>Sub4