theguy0000 Posted October 15, 2005 Share Posted October 15, 2005 (edited) #include <misc.au3> FileChangeDir ( @ScriptDir ) $compile = _compile ( 'compileTest.au3', 'compileTest.exe' ) If $compile = 1 Then MsgBox ( 64, "Information", "Script compiled successfully" ) ElseIf $compile = 0 Then MsgBox ( 64, "Information", "Script wasn't compiled. An unknown error occured during compilation." ) ElseIf $compile = -1 Then MsgBox ( 64, "Information", "Script wasn't compiled. Either the source file wasn't found, or it wasn't an AutoIt v3 script." ) ElseIf $compile = -2 Then MsgBox ( 64, "Information", "Script wasn't compiled. Destination must be an executable file (exe)" ) ElseIf $compile = -3 Then MsgBox ( 64, "Information", "Script wasn't compiled. Icon specified was either not found, or not an icon file (ico)" ) ElseIf $compile = -4 Then MsgBox ( 64, "Information", "Script wasn't compiled. Aut2Exe.exe was not found." ) EndIf i get an error about this line: ElseIf $compile = 0 Then MsgBox ( 64, "Information", "Script wasn't compiled. An unknown error occured during compilation." ) C:\Documents and Settings\Pat\My Documents\autoit\compileTestRun.au3(5,1) : ERROR: syntax error ElseIf ^ whats wrong here? Edited October 15, 2005 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Valuater Posted October 15, 2005 Share Posted October 15, 2005 each if or elsif would need an edif... but this is easier #include <misc.au3> FileChangeDir ( @ScriptDir ) $compile = _compile ( 'compileTest.au3', 'compileTest.exe' ) If $compile = 1 Then MsgBox ( 64, "Information", "Script compiled successfully" ) If $compile = 0 Then MsgBox ( 64, "Information", "Script wasn't compiled. An unknown error occured during compilation." ) If $compile = -1 Then MsgBox ( 64, "Information", "Script wasn't compiled. Either the source file wasn't found, or it wasn't an AutoIt v3 script." ) If $compile = -2 Then MsgBox ( 64, "Information", "Script wasn't compiled. Destination must be an executable file (exe)" ) If $compile = -3 Then MsgBox ( 64, "Information", "Script wasn't compiled. Icon specified was either not found, or not an icon file (ico)" ) If $compile = -4 Then MsgBox ( 64, "Information", "Script wasn't compiled. Aut2Exe.exe was not found." ) 8) Link to comment Share on other sites More sharing options...
Developers Jos Posted October 15, 2005 Developers Share Posted October 15, 2005 (edited) whats wrong here?When you have an IF like this its considered to be a ONE LINE IF statements.If $compile = 1 Then MsgBox(64, "Information", "Script compiled successfully")This will work:#include <misc.au3> FileChangeDir(@ScriptDir) $compile = _compile ('compileTest.au3', 'compileTest.exe') If $compile = 1 Then MsgBox(64, "Information", "Script compiled successfully") ElseIf $compile = 0 Then MsgBox(64, "Information", "Script wasn't compiled. An unknown error occured during compilation.") ElseIf $compile = -1 Then MsgBox(64, "Information", "Script wasn't compiled. Either the source file wasn't found, or it wasn't an AutoIt v3 script.") ElseIf $compile = -2 Then MsgBox(64, "Information", "Script wasn't compiled. Destination must be an executable file (exe)") ElseIf $compile = -3 Then MsgBox(64, "Information", "Script wasn't compiled. Icon specified was either not found, or not an icon file (ico)") ElseIf $compile = -4 Then MsgBox(64, "Information", "Script wasn't compiled. Aut2Exe.exe was not found.") EndIf Edited October 15, 2005 by JdeB 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...
theguy0000 Posted October 15, 2005 Author Share Posted October 15, 2005 (edited) now i get an error about File.au3, which i haven't even touched... Func _FileCountLines($sFilePath) Local $N = FileGetSize($sFilePath) - 1 If @error Or $N = -1 Then Return 0 Return StringLen(StringAddCR(FileRead($sFilePath, $N))) - $N + 1 EndFunc ;==>_FileCountLines line 24: Func statement has no matching EndFunc But whats wierd is, it only comes up with that error if i include it, but if i run File.au3 directly, i dont get any errors. Edited October 15, 2005 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Developers Jos Posted October 15, 2005 Developers Share Posted October 15, 2005 (edited) now i get an error about File.au3, which i haven't even touched...Func _FileCountLines($sFilePath) Local $N = FileGetSize($sFilePath) - 1 If @error Or $N = -1 Then Return 0 Return StringLen(StringAddCR(FileRead($sFilePath, $N))) - $N + 1 EndFunc;==>_FileCountLinesline 24: Func statement has no matching EndFuncBut whats wierd is, it only comes up with that error if i include it, but if i run File.au3 directly, i dont get any errors.Long shot: Did you put the #include<file.au3> inside a Func...EndFunc ??? If not you need to show your code.... Edited October 15, 2005 by JdeB 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...
theguy0000 Posted October 15, 2005 Author Share Posted October 15, 2005 Long shot: Did you put the #include<file.au3> inside a Func...EndFunc ??? If not you need to show your code.... oh, yes i did thanks The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN 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