Jump to content

[SOLVED] ProgressBar - Two different result


Recommended Posts

Hi guys, i have ther two script made with a help of some forumer :)

The GUI

$GUI = GUICreate("Test", 545, 267, -1, -1)
$ProgressBar = GUICtrlCreateProgress(16, 226, 512, 25)
$ProgressLabel = GUICtrlCreateLabel("Status: Ready", 16, 211, 511, 17)

The working script:

Func _FileDelete()

For $I = 1 To $List[0]
$ProgressSet = Int($I / ($List[0]) * 100)
GUICtrlSetData($ProgressBar, $ProgressSet)
FileDelete($List[$I])
GUICtrlSetData($ProgressLabel, "Status: Files deleting... " & $List[0] - $I)
Next
GUICtrlSetData($ProgressLabel, "Status: Ready")
GUICtrlSetData($ProgressBar, 0)
EndFunc

The script not working

Func _FileMove()

$Destination = FileSelectFolder("Select folder...", "", 0, @WorkingDir)
If @error Then
  MsgBox(16, "Error", "No folder")
  Return
EndIf

For $I = 1 To $List[0]
$ProgressSet = Int($I / ($List[0]) * 100)
FileMove($List[$I],$Destination)
GUICtrlSetData($ProgressLabel, "Status: Files moving... " & $List[0] - $I)
Next
GUICtrlSetData($ProgressLabel, "Status: Ready")
GUICtrlSetData($ProgressBar, 0)
EndFunc

The first work the progressbar an the label update with decreasing number. The second only decreasing number, progressbar don't working

I don't understand why, FileDelete is not comparable to FileMove? If i move or delete from the array file is not the same for the script?

Thanks for support ;)

Edited by johnmcloud
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

×
×
  • Create New...