Jump to content
Sign in to follow this  
gzd

RunWait

Recommended Posts

gzd

Hi,

I have a GUI where you select parameters and then press the execute button.

Then i want 3 external programs to run successive, so i have called it with RunWait.

The problem is that when the program is running the GUI is blocked till the first run completed.

I want it to run as many times the user select but keep on the serial execution of the program steps

Thanks

Share this post


Link to post
Share on other sites
martin

Hi,

I have a GUI where you select parameters and then press the execute button.

Then i want 3 external programs to run successive, so i have called it with RunWait.

The problem is that when the program is running the GUI is blocked till the first run completed.

I want it to run as many times the user select but keep on the serial execution of the program steps

Thanks

Store the requests to run with the parameters etc in an array, something like

Dim $array[20][2];start with room for 20 programs
$runnum = 0;nothing has been run yet
$requestnum = 0;nothing has been requested to run yet
while 1

if $runnum < $requestnum then
 if $runnum = 0 or not processexists($array[$runnum][0]) then
   run($array[$requestnum][0] & $array[$requestnum][1]);<--only written as idea needs formatting
   $runnumber += 1 
 endif
endif

  $msg = GuiGetMsg()
  switch $Msg
         .
         .
    Case $addnewprog
         $requestnum += 1
         If ubound($array,1) <= $requestnum then Redim $array[$requestNum + 2][2]
         $array[$requestnum][0] = $progtorun
         $array[$requestnum][1] = $paramstring


  endswitch

wend
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
gzd

Store the requests to run with the parameters etc in an array, something like

Dim $array[20][2];start with room for 20 programs
$runnum = 0;nothing has been run yet
$requestnum = 0;nothing has been requested to run yet
while 1

if $runnum < $requestnum then
 if $runnum = 0 or not processexists($array[$runnum][0]) then
   run($array[$requestnum][0] & $array[$requestnum][1]);<--only written as idea needs formatting
   $runnumber += 1 
 endif
endif

  $msg = GuiGetMsg()
  switch $Msg
         .
         .
    Case $addnewprog
         $requestnum += 1
         If ubound($array,1) <= $requestnum then Redim $array[$requestNum + 2][2]
         $array[$requestnum][0] = $progtorun
         $array[$requestnum][1] = $paramstring


  endswitch

wend

Thanks for your reply,

Sorry if i missunderstand your solution, but when pressing then button i expect that 3 programs will run one after another waiting to each other to finish in a serial way. I want the user to be able to press the button few times.

From your solution i understand how to limit the number of programs that can be run at certain time, but not how to control the sucssesive run of the 3 programs in each button press.

Share this post


Link to post
Share on other sites
martin

Thanks for your reply,

Sorry if i missunderstand your solution, but when pressing then button i expect that 3 programs will run one after another waiting to each other to finish in a serial way. I want the user to be able to press the button few times.

From your solution i understand how to limit the number of programs that can be run at certain time, but not how to control the sucssesive run of the 3 programs in each button press.

My example was meant to show how you could choose a program and the parameters for it and then choose another program, or maybe the same one, with parameters again and keep going as long as you want for hundreds of programs if you like. The programs will be executed in the order you chose them with the parameters you give, and only when one program finishes will the next one be run. There is no limit in my example. The idea can be adapted to do what you want I should think.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×