Denis Posted October 11, 2006 Share Posted October 11, 2006 It works neither in this form:SetError(0)FileReadLine($File1)If @error ThenSetError(0)FileReadLine($File2)If @error Then FinalMessage("Equal")Else FinalMessage("Not equal - 2 is longer")EndIfFinalMessage("Not equal - 1 is longer")nor in this:SetError(0)FileReadLine($File1)If @error ThenSetError(0) FileReadLine($File2) If @error Then FinalMessage("Equal")EndIfElse FinalMessage("Not equal - 2 is longer")EndIfFinalMessage("Not equal - 1 is longer")nor in this one:SetError(0)FileReadLine($File1)If @error ThenSetError(0) FileReadLine($File2) If @error Then FinalMessage("Equal")elseEndIfElse FinalMessage("Not equal - 2 is longer")EndIfFinalMessage("Not equal - 1 is longer")It works as this:SetError(0)FileReadLine($File1)If @error Then SetError(0) FileReadLine($File2) If @error Then FinalMessage("Equal")Else FinalMessage("Not equal - 2 is longer") EndIfEndIfFinalMessage("Not equal - 1 is longer")but I still don't like the entire matter - it may occur again in much worse state.//Func FinalMessage (Const $MessageName)// MsgBox(0,$MessageName,TimerDiff($timerstart))// WinWait($MessageName)// Exit//EndFunc Link to comment Share on other sites More sharing options...
xcal Posted October 11, 2006 Share Posted October 11, 2006 The first one should look like this: If @error Then SetError(0) FileReadLine($File2) If @error Then FinalMessage ("Equal") Else FinalMessage ("Not equal - 2 is longer") EndIf EndIf FinalMessage ("Not equal - 1 is longer") How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
MHz Posted October 11, 2006 Share Posted October 11, 2006 You cannot add code on the same line after the Else keyword. expandcollapse popupSetError(0) FileReadLine($File1) If @error Then SetError(0) FileReadLine($File2) If @error Then FinalMessage("Equal") Else FinalMessage("Not equal - 2 is longer") EndIf FinalMessage("Not equal - 1 is longer") ;nor in this: SetError(0) FileReadLine($File1) If @error Then SetError(0) FileReadLine($File2) If @error Then FinalMessage("Equal") EndIf Else FinalMessage("Not equal - 2 is longer") EndIf FinalMessage("Not equal - 1 is longer") ;nor in this one: SetError(0) FileReadLine($File1) If @error Then SetError(0) FileReadLine($File2) If @error Then FinalMessage("Equal") else ;something here EndIf Else FinalMessage("Not equal - 2 is longer") EndIf FinalMessage("Not equal - 1 is longer") ;It works as this: SetError(0) FileReadLine($File1) If @error Then SetError(0) FileReadLine($File2) If @error Then FinalMessage("Equal") Else FinalMessage("Not equal - 2 is longer") EndIf EndIf FinalMessage("Not equal - 1 is longer") ;but I still don't like the entire matter - it may occur again in much worse state. ;Func FinalMessage (Const $MessageName) ; MsgBox(0,$MessageName,TimerDiff($timerstart)) ; WinWait($MessageName) ; Exit ;EndFunc 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