 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
sosaited
Joined: 24 Feb 2005 Posts: 233
|
Posted: Wed Mar 09, 2005 7:19 pm Post subject: Progress Bar HELP |
|
|
Hi…
Here’s part of the script I am having a bit problem with
| Code: | Loop, %SEARCHPATH%\*.*, 1
{
vTOTALFILES = %a_index%
}
Loop, %SEARCHPATH%\*.*, 1
{
Progress, R0-%vTOTALFILES%
Progress, %a_index%, a, Testing, t
IfEqual, a_index, %vTOTALFILES%
Progress, Off
} |
now the script works fine… except when it shows the progress bar… the bar keeps “blinking” and it blinks so fast that it looks weird…
any idea how to fix that? And one more thing… the first part of the script (to count the number of files)… completes in a second… (Depending on the number of files)…. But the “progress bar” part takes much time…. any tips? Last thing… how can I Embed the progress bar in a GUI? |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Wed Mar 09, 2005 7:24 pm Post subject: |
|
|
Try: | Changed Code wrote: | Loop, %SEARCHPATH%\*.*, 1
{
vTOTALFILES = %a_index%
}
Loop, %SEARCHPATH%\*.*, 1
{
Progress, R0-%vTOTALFILES%
Progress, %a_index%, a, Testing, t
IfEqual, a_index, %vTOTALFILES%
}
Progress, Off |
_________________
 |
|
| Back to top |
|
 |
sosaited
Joined: 24 Feb 2005 Posts: 233
|
Posted: Wed Mar 09, 2005 7:39 pm Post subject: |
|
|
i tried it.. bit first it gave an error BEFORE running the script.. and that was :
"The Line beneath this IF or LOOP is an invalid function"
.....-->IfEqual, ...."
so then i realized that the should be within the Block OR the should be out... so i did that...
but still the same problem ... and now it doesnt even close automatically ... so help on this one... and give tips on other two things too  |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Wed Mar 09, 2005 8:04 pm Post subject: |
|
|
Here's a different way I would go about it: | Code: | Loop, %SearchPath%\*.*, 1
{
TotalFiles = %A_Index%
}
Progress, R0-%TotalFiles%
TotalProgress = 0
Loop, %TotalFiles%
{
TotalProgress += 1
Progress, %TotalProgress%, a, Testing, t
}
Progress, Off | Untested. _________________
 |
|
| Back to top |
|
 |
sosaited
Joined: 24 Feb 2005 Posts: 233
|
Posted: Wed Mar 09, 2005 8:11 pm Post subject: |
|
|
Thanks Titan.... it worked.,.. but the speed of progress bar is still slow compared to the time it takes the Loop to count files ... anyways... now how can i Embed this in the GUI?  |
|
| Back to top |
|
 |
ILL.1
Joined: 29 Sep 2004 Posts: 84
|
Posted: Wed Mar 09, 2005 8:19 pm Post subject: |
|
|
Look at the GUI command in the help file. GUI, Add, Progress... _________________ ===============
----------ILL.1-----------
=============== |
|
| Back to top |
|
 |
sosaited
Joined: 24 Feb 2005 Posts: 233
|
Posted: Wed Mar 09, 2005 8:35 pm Post subject: |
|
|
| i tried that in the first place.... but it aint working... maybe cause of the BLOCK... so what do i have to do now.. |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Wed Mar 09, 2005 8:52 pm Post subject: |
|
|
| sosaited wrote: | how can i Embed this in the GUI?  | Something like this worked for me: | Code: | Gui, Add, Progress, vProgressBar w250 -Smooth
Gui, Show, , My Progress Bar
Loop, %SearchPath%\*.*, 1
{
TotalFiles = %A_Index%
GuiControl, , ProgressBar, +%A_Index%
}
Return
GuiClose:
ExitApp |
Adjust the above code to your needs. Because I don't know the length or an expected approximation I can't suit the progress bar accordingly so if this Gui Progress isn't working to satisfaction you may need to do some tweaking. _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|