rbk Posted April 24, 2007 Posted April 24, 2007 (edited) $ver = 0 If $ver = "title" Then => TRUE $ver = "title" If $ver <> 0 Then => FALSE ----------------------------- WinGetTitle() Return Value is text(Success) or numeric 0(Failure) $title = WinGetTitle("Google -", "") If $title = "Google - Microsoft Internet Explorer" Then => case $title = 0 TRUE If $title <> 0 And $title = "Google - Microsoft Internet Explorer" Then => case $title = "Goo ..." $title <> 0 FALSE How can i check Failure or Success?(using @error?) Thanks. Edited April 24, 2007 by rbk
darkshadow791 Posted April 24, 2007 Posted April 24, 2007 Please use code tags... I can't understand your code. Note Taker Lite - a note taking / converting tool.
rbk Posted April 24, 2007 Author Posted April 24, 2007 (edited) $ver = 0 If $ver = "title" Then => TRUE $ver = "title" If $ver <> 0 Then => FALSE ----------------------------- WinGetTitle() Return Value is text(Success) or numeric 0(Failure) $title = WinGetTitle("Google -", "") If $title = "Google - Microsoft Internet Explorer" Then => case $title = 0 TRUE If $title <> 0 And $title = "Google - Microsoft Internet Explorer" Then => case $title = "Goo ..." $title <> 0 FALSE How can i check Failure or Success?(using @error?) Thanks. $oIE = _IECreate ("http://www.google.co.kr") $ret1 = _IELoadWait ($oIE,100,10000) If $ret1 <> 1 Then _IEQuit ($oIE) return 1 EndIf Sleep(3000) $title = WinGetTitle("Google -", "") If $title <> 0 And $title = "Google - Microsoft Internet Explorer" Then _IEQuit ($oIE) ;MsgBox(0,"", $title) return 0 EndIf _IEQuit ($oIE) return 1 Edited April 24, 2007 by rbk
someone Posted April 24, 2007 Posted April 24, 2007 I'm confused at what you are asking, but my best guess is you want to have an if/else statement for a wingettitle function... Try this, with the autoit help window $title = WinGetTitle("AutoIt Help") If $title = "0" Then MsgBox(0, "Error", "WinGetTitle error") Else MsgBox(0, "Success", $title) EndIf (note that wasn't using the newest beta but version 3.2.2.0) A few things though, IECreate automatically waits for the page to load($f_wait) so adding IELoadWait isn't needed, also using return only works in a Func/EndFunc. Read up on Return and also SetError. If this isn't what you wanted try to explain what you are coding. Welcome to the forum! While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
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