Jump to content

Do...Until help


Recommended Posts

This is a snippet from my code that seems to freeze the script, and nothing works, any ideas why?

$NewCF = FileSaveDialog("Save to...", "", "Content.res (*.res)", 16, "Content.res")
If Not @error Then
    $NewExt = StringSplit($NewCF, ".")
    If @error Then
        $NewCF = $NewCF & ".res"
    ElseIf Not $NewExt[$NewExt[0]] = "res" Then
        $NewCF = $NewCF & ".res"
    EndIf
EndIf
$CFilesList = 'ach01.png,ach01x.png,ach02.png,ach02x.png,ach03.png,ach03x.png,ach04.png,ach04x.png,ach05.png,ach05x.png,ach06.png,ach06x.png,ach07.png,ach07x.png,ach08.png,ach08x.png,ach09.png,ach09x.png,ach10.png,ach10x.png,ach11.png,ach11x.png,ach12.png,ach12x.png,ach13.png,ach13x.png,ach14.png,ach14x.png,ach15.png,ach15x.png,ach16.png,ach16x.png,ach17.png,ach17x.png,ach18.png,ach18x.png,ach19.png,ach19x.png,ach20.png,ach20x.png,ach21.png,ach21x.png,ach22.png,ach22x.png,ach23.png,ach23x.png,ach24.png,ach24x.png,ach25.png,ach25x.png,alarm.wav,bossBlobFire.wav,bossFireCircles.wav,bossLineFire.wav,bossMissileFire.wav,bossPreLineFire.wav,cloud1.png,cloud2.png,ColdBeam.png,controller.png,crystal1.png,crystal2.png,explosion1.wav,explosion2.wav,explosion3.wav,fire.wav,font.fnt,font.png,glass.png,Hard_Core_Gamer.mp3,Head_Spinning.mp3,hge.png,icon beathazard.png,icon computer.png,icon drive.png,icon file.png,icon folder.png,icon shortcut.png,icon up.png,icon yes.png,In_The_Outer_Zone.mp3,Little_Wack.mp3,logo.png,LogoGameplayPowered.png,Looming_Over_You.mp3,Lunacy_Hypocrisy.mp3,Mad_Mad_Mad.mp3,menu.wav,Mixed_Up_World.mp3,news.png,Off_Your_Rear_End.mp3,PC arrows.png,PC Backspace.png,PC Enter.png,PC Esc.png,PC H.png,PC Left Arrow.png,PC LeftClick.png,PC Mouse.png,PC N.png,PC Right Arrow.png,PC RightClick.png,PC tutorial.png,PC UpDown.png,PC V.png,rank00.png,rank01.png,rank02.png,rank03.png,rank04.png,rank05.png,rank06.png,rank07.png,rank08.png,rank09.png,rank10.png,rank11.png,rank12.png,rank13.png,rank14.png,rank15.png,rank16.png,rank17.png,rank18.png,rank19.png,rank20.png,rank21.png,rank22.png,rank23.png,rank24.png,rank25.png,rank26.png,sand1.png,sand2.png,ship_hit.wav,smoke.png,smoke2.png,spriteSheet1.png,spriteSheet1.res,star1.png,star2.png,TheVizLogo.png,ui1.wav,ui_back.wav,ui_back_woosh.wav,ui_in_woosh.wav,ui_select.wav,ui_woosh_1.wav,ui_woosh_10.wav,ui_woosh_11.wav,ui_woosh_12.wav,ui_woosh_13.wav,ui_woosh_14.wav,ui_woosh_15.wav,ui_woosh_2.wav,ui_woosh_3.wav,ui_woosh_4.wav,ui_woosh_5.wav,ui_woosh_6.wav,ui_woosh_7.wav,ui_woosh_8.wav,ui'
$CFilesList &= '_woosh_9.wav,ui_woosh_fade.wav,un4seen.png,xboxA.png,xboxB.png,xboxX.png,xboxY.png'
$CFile = StringSplit($CFilesList, ",")
$n = 1
$MissingFiles = ""
Do
    If Not FileExists($NewCP & $CFile[$n]) Then
        $MissingFiles &= $CFile[$n] & @CRLF
        $n = $n + 1
    EndIf
Until $n = 168
If $MissingFiles Then
    MsgBox(16, "Missing files!", "The following files are missing from the folder you have chosen:" & @CRLF & @CRLF & $MissingFiles)
Else
    _7ZipAdd(0, $NewCF, $NewCP, 0, 5, 1, 0, 0, 0, 0, "zip")
EndIf
Edited by zeffy
Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

Wild guess.

If Not FileExists($NewCP & $CFile[$n]) Then
        $MissingFiles &= $CFile[$n] & @CRLF
        $n = $n + 1
    EndIf

Will only update $n on FilesExits() that fail, So is it finds a file that exist ... it keeps testing that particular file forever.

(move the $n update part outside the If block)

Thanks :idea:
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...