AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Progress Bar HELP

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
sosaited



Joined: 24 Feb 2005
Posts: 233

PostPosted: Wed Mar 09, 2005 7:19 pm    Post subject: Progress Bar HELP Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Wed Mar 09, 2005 7:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sosaited



Joined: 24 Feb 2005
Posts: 233

PostPosted: Wed Mar 09, 2005 7:39 pm    Post subject: Reply with quote

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
Code:
Progress, Off
should be within the Block OR the
Code:
IfEqual, ....
should be out... so i did that...
but still the same problem ... and now it doesnt even close automatically Crying or Very sad ... so help on this one... and give tips on other two things too Idea
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Wed Mar 09, 2005 8:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sosaited



Joined: 24 Feb 2005
Posts: 233

PostPosted: Wed Mar 09, 2005 8:11 pm    Post subject: Reply with quote

Thanks Titan.... it worked.,.. but the speed of progress bar is still slow compared to the time it takes the Loop to count files Rolling Eyes ... anyways... now how can i Embed this in the GUI? Confused
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ILL.1



Joined: 29 Sep 2004
Posts: 84

PostPosted: Wed Mar 09, 2005 8:19 pm    Post subject: Reply with quote

Look at the GUI command in the help file. GUI, Add, Progress...
_________________
===============
----------ILL.1-----------
===============
Back to top
View user's profile Send private message
sosaited



Joined: 24 Feb 2005
Posts: 233

PostPosted: Wed Mar 09, 2005 8:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Wed Mar 09, 2005 8:52 pm    Post subject: Reply with quote

sosaited wrote:
how can i Embed this in the GUI? Confused
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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group