Experience is something you get after you neeeded it, Help!

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ainterne
Junior Coder
Posts: 29
Joined: Tue Jun 05, 2007 4:03 am

Experience is something you get after you neeeded it, Help!

Post by ainterne » Thu Apr 23, 2009 8:23 am

I have a couple of problems I need to get past.....and need some wisdom please...

I am building a toolbox of utils. As there are many buttons on the dialog, I wanted to not include all the code in the main script but rather have the script run other small scripts that are in the prog dir.

So I have two questions,

a: What is the best way to pass a variable from one script to another, or do I just have to write it out to disk and have the other script pick it up.

b: In the example below I am calling a ping function in another script that
results in success or failure. I want to give the illusion in the dialog box that the ping is running. To do this I wanted to turn on a series of green lights one by one if the ping is good. So I have done it the way below. I works great untill I have to close the dialog3 or I would get "Cannot make visable window modal" The problem I am getting is the that when I close and open Dialog3 then I get that visable jump of the dialog box where it closes and opens.

Does anyone have any ideas on how I can get around this and make the close and open much smoother, or not have to do the open,close?

Code: Select all


Label>MainLoop
  Show>Dialog3,result
   If>result=2,End
   If>result=1,Ping
Goto>MainLoop

      SRT>Ping
          Macro>C:\Program Files\DnsOpsTool\Bin\Ping Function.scp
          //Get var back..somehow.
          If>var=0
          // put someting on screen
          Endif

          If>var=1
          Show>Dialog3
          SetDialogObjectVisible>Dialog3,msImage10,1
          Wait>1
          ResetDialogAction>Dialog3
          Wait>1
          SetDialogObjectVisible>Dialog3,msImage11,1
          Goto>SecondLoop
          Endif

      END>Ping
Label>End

Many thanks for any help with this.....
Phil.......

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Thu Apr 23, 2009 9:34 am

Macro Scheduler supports passing value(s) to the called macro.
eg Macro>C:\Program Files\DnsOpsTool\Bin\Ping Function.scp /Result=1

For testing purpose, you may add the following statements at the top in your Ping Function.scp
Msg>%Macro_Parms%
wait>30
Exit
At least you have some idea about the parameter(s) passing.

After your Ping Function.scip is done, you can store the value to MACRO_RESULT, which will be passed back to the calling script.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts