Jump to content
Sign in to follow this  
Skrip

Progress bar....not 100 limit?

Recommended Posts

Skrip

I have a script that scans a file for how many lines, and I need it to set the limit to the amount of lines, but it doesn't seem to work..

$lines = _FileCountLines($wordlist)
GUICtrlSetLimit($Progress1, $lines, 0)
GUICtrlSetData($Progress1, $line)

>,,< nooby question...

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
monoceres

What is the value of $line?


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Skrip

It is within a loop. It increases by 1 each time, until it hits the end of the file ($line = $lines)


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
TomZ

A progressbar is designed to display a progress (DOH) in percents. You can only use a progressbar to display that, you can't use it to display a value. Example of progressbar use below:

$total = 10000

For $current = 1 to 10000

GUICtrlSetData($progressBar, ($current / $total) * 100)

Sleep(1)

Next

Edited by TomZ

Share this post


Link to post
Share on other sites
monoceres

I can't get it to work :)

Is it the same thing as your problem?

Dim $array[5000]
GUICreate("hello",300,200)
GUICtrlCreateProgress(10,10,280,180)
GUICtrlSetLimit(-1,Ubound($array),0)
GUISetState()
For $i=0 To Ubound($array)-1
    sleep(50)
    GUICtrlSetData(-1,$i)
Next
; The progress bar is already filled up, long time ago
MsgBox(0,"","")

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
TomZ

Monocres, instead of setting the total as value for the progressbar, set the total value devided by the maximum value multiplied by 100. A progressbar is to display PERCENT, not any other amount. GUICtrlSetLimit has nothing to do with progressbars.

Share this post


Link to post
Share on other sites
Skrip

A progressbar is designed to display a progress (DOH) in percents. You can only use a progressbar to display that, you can't use it to display a value. Example of progressbar use below:

$total = 10000

For $current = 1 to 10000

GUICtrlSetData($progressBar, ($current / $total) * 100)

Sleep(1)

Next

Works. Thank you.

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
monoceres

Monocres, instead of setting the total as value for the progressbar, set the total value devided by the maximum value multiplied by 100. A progressbar is to display PERCENT, not any other amount. GUICtrlSetLimit has nothing to do with progressbars.

That's what I usually do, because I never got GUICtrlSetLimit to work.

Now I know why :)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
rasim

Yes, GUICtrlSetLimit() function works with: List, Input/Edit, Slider and UpDown controls.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.