LiquidPerceptions Posted May 1, 2007 Share Posted May 1, 2007 I need to be able to have one function run, while another runs as well. What I am trying to accomplish is have my "ProgressSet" run while my "FileCopy" runs as well. What I did was create two .exe's. When it was time for my "FileCopy" function just before, it opened the "progress.exe". Then after "FileCopy" was over, it closed the process. Problem is, I'd like to only have one executable. I tried to include the .au3 but it only loaded the progress bar, never started the "FileCopy". I did search extensivly throughout the forum, and I apologize if someone has already posted this. I have seen the "actual" progress bars, but that's not what I'm trying to achieve. I also want the progress bar to set back to zero after it hits 100%, hence the repeat in the ProgressBar function. This is what I was thinking, but obviously doesn't work. While FileCopyFunction() ProgressBar() WEnd Func FileCopyFunction() FileCopy( $begindir, $enddir, 1) EndFunc Func ProgressBar() ProgressOn("Progress Bar", "Copying Files...", "0 %",-1,-1,1) For $i = 1 to 100 step 1 ProgressSet($i, $i & " %") sleep(random(0,150)) Next ProgressBar() EndFunc Any help, or information would be greatly appreciated.. "I'm not here to make decisions, I'm here to make a difference" Link to comment Share on other sites More sharing options...
smashly Posted May 1, 2007 Share Posted May 1, 2007 From looking at your progressbar() function to me it looks like it wouldn't work. Func ProgressBar() ProgressOn("Progress Bar", "Copying Files...", "0 %",-1,-1,1) For $i = 1 to 100 step 1 ProgressSet($i, $i & " %") sleep(random(0,150)) Next ProgressBar() ;<--- Your already in this function and your trying to call it again before it's finished. EndFunc maybe do a While/WEnd or Do/Until loop in the function and use another part of the script to set s global variable so that the function quits when the global variable is set. Or maybe can use AdlibEnable and AdlibDisable to acomplish what your after. Cheers Link to comment Share on other sites More sharing options...
xian7479 Posted May 2, 2007 Share Posted May 2, 2007 Your FileCopyFunction() does not return a value, how does the While loop determine the expression is true or false? Link to comment Share on other sites More sharing options...
Uten Posted May 2, 2007 Share Posted May 2, 2007 Several techniques are described in the forum. Do a search for Thread* in The scripts forum. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now