Skrip Posted June 25, 2008 Share Posted June 25, 2008 (edited) 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 June 25, 2008 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] Link to comment Share on other sites More sharing options...
monoceres Posted June 25, 2008 Share Posted June 25, 2008 What is the value of $line? Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Skrip Posted June 25, 2008 Author Share Posted June 25, 2008 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] Link to comment Share on other sites More sharing options...
TomZ Posted June 25, 2008 Share Posted June 25, 2008 (edited) 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 June 25, 2008 by TomZ Link to comment Share on other sites More sharing options...
monoceres Posted June 25, 2008 Share Posted June 25, 2008 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! Link to comment Share on other sites More sharing options...
TomZ Posted June 25, 2008 Share Posted June 25, 2008 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. Link to comment Share on other sites More sharing options...
Skrip Posted June 25, 2008 Author Share Posted June 25, 2008 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 = 10000For $current = 1 to 10000 GUICtrlSetData($progressBar, ($current / $total) * 100) Sleep(1)NextWorks. 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] Link to comment Share on other sites More sharing options...
monoceres Posted June 25, 2008 Share Posted June 25, 2008 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! Link to comment Share on other sites More sharing options...
rasim Posted June 25, 2008 Share Posted June 25, 2008 Yes, GUICtrlSetLimit() function works with: List, Input/Edit, Slider and UpDown controls. 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