Jump to content

Running Multiple Functions


Recommended Posts

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...