Jump to content

Recommended Posts

Posted (edited)

ok, i'm making a script with a GUI that has start/stop numbers. when the user types in anything higher then 1million (1000000) then the program halts and you have to right click the icon in the system tray to exit out.

heres a portion of my script that deals what happens when the user hits "start"

Case $msg = $Buttonstart
     $istart = GUICtrlRead($inputstart)
     $istop = GUICtrlRead($inputstop)
     $iext = GUICtrlRead($inputext)
     $ipath = GuiCtrlRead($InputFolder)
     $ifile = GuiCtrlRead($InputFile)
     $count = 1
    for $i = $istart to $istop
        If FileExists($ipath & $ifile & $i & $iext) Then
            ClipPut($ipath & $ifile & $i & $iext)
            GUICtrlSetData($Listbox,$ipath & $ifile & $i & $iext)
            $count = $count+1
        Else            
        $count = $count+1
    EndIf
    GuiCtrlSetData($Labelcurr,"Current File: " & $ipath & $ifile & $i & $iext)
    next

please note what i did wrong, if i put 999999 for the stop number then it doesn't have a problem, only when its 1000000 or higher then it halts.

if i manually set the stop number by putting:

for $i = $istart to 4000000

then it doesn't have a problem...

thanks :)

Edited by Bi0haZarD
Posted

try wrapping the GUICtrlRead functions with Int(). I believe that its passing the text as a string, and not a number.

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Posted

Can I ask why you needed to loop something more than a million times? I don't think I've ever heard of an array even 1/10 that size loaded into memory :)

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Posted (edited)

needed some way to increment file names for my script "ReSave" as seen here

since the recovery program that i used renamed files to "cluster ######.JPG" the cluster number refering to where the picture was on the hard drive.. so the max number could be really high depending on the size of the hard drive and where the image was located on the drive.

Edited by Bi0haZarD

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
×
×
  • Create New...