Fanatick Posted August 23, 2008 Share Posted August 23, 2008 (edited) Hey , i have a error line 10 , if you can help me thanks I found the error line 10 but now i have a error line 13 ^^ Error : "EndIf" statement with no matching "If" statement #include <File.au3> Dim $Res Dim $File = "File.txt"; File to find. $aDrv = DriveGetDrive("FIXED") ;A circle who search and attribut to the first find file $File find. For $i = 1 To $aDrv[0] $aFile = _FileListToArrayEx2($aDrv[$i], $File, 1, "", True) If IsArray($aFile) And $aFile[1] <> "" Then $Res = $aFile[1] ExitLoop EndIf Next ; If a file is find then : If $Res <> "" Then Dim $szDrive, $szDir, $szFName, $szExt $TestPath = _PathSplit($Res, $szDrive, $szDir, $szFName, $szExt) $chemin = $szDrive & $szDir $NomFichier = $szFName & $szExt MsgBox(0, "", "Fileacess = " & $Fileacess & @CRLF & "File = " & $Filename) ; Otherwise ... Else MsgBox(16, "Error", "The file was not find") EndIf Edited August 23, 2008 by Fanatick Link to comment Share on other sites More sharing options...
FlintBrenick Posted August 23, 2008 Share Posted August 23, 2008 What is this script suppose to do? I couldn't read the remarks in the code since I only speak English. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 23, 2008 Share Posted August 23, 2008 (edited) A If can't be both single-line and multi-line at the same time! Edited August 23, 2008 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
FlintBrenick Posted August 23, 2008 Share Posted August 23, 2008 Change it to: If IsArray($aFile) And $aFile[1] <> "" Then $Res = $aFile[1] ExitLoop EndIf If the "ExitLoop" is suppose to be an "else" action then it would look like this: If IsArray($aFile) And $aFile[1] <> "" Then $Res = $aFile[1] Else ExitLoop EndIf ~Flint Brenick~ Link to comment Share on other sites More sharing options...
Developers Jos Posted August 23, 2008 Developers Share Posted August 23, 2008 Tidy makes your life realy easier with these sort of issues. #include <File.au3> Dim $Res Dim $File = "File.txt"; File to find. $aDrv = DriveGetDrive("FIXED") ;A circle who search and attribut to the first find file $File find. For $i = 1 To $aDrv[0] $aFile = _FileListToArrayEx2($aDrv[$i], $File, 1, "", True) If IsArray($aFile) And $aFile[1] <> "" Then $Res = $aFile[1] ExitLoop ;### Tidy Error -> "endif" is closing previous "for" on line 7 EndIf ;### Tidy Error: next line creates a negative tablevel. ;### Tidy Error: next line creates a negative tablevel for the line after it. Next ; If a file is find then : If $Res <> "" Then Dim $szDrive, $szDir, $szFName, $szExt $TestPath = _PathSplit($Res, $szDrive, $szDir, $szFName, $szExt) $chemin = $szDrive & $szDir $NomFichier = $szFName & $szExt MsgBox(0, "", "Fileacess = " & $Fileacess & @CRLF & "File = " & $Filename) ; Otherwise ... Else MsgBox(16, "Error", "The file was not find") EndIf SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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