Sign in to follow this  
Followers 0
rbk

Help me. Basic Syntax

4 posts in this topic

#1 ·  Posted (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 :shocked:

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 by rbk

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 :shocked:

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 by rbk

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0