Jump to content

IF Or, AND Commands


Recommended Posts

Func connectbekleme()
    $x1 = 0
    $y1 = 0
    Do
        $arama3 = _ImageSearch("Images\connect.bmp", 1, $x1, $y1, 0)
        $arama3xb = _ImageSearch("Images\connect2.bmp", 1, $x1, $y1, 0)
        If $arama3 = 1 Or $arama3xb = 1 Then
        Else
            Sleep(1000)
        EndIf
    Until $arama3 = 1 Or $arama3xb = 1
EndFunc ;==>connectbekleme

if $arama3 = 1 Or $arama3xb =1 Then not running whats wrong?

Edited by DeSwa
Link to comment
Share on other sites

  • Moderators

What is _ImageSearch?

When you post a question, why not try and post a working example... so we don't just throw guess out.

Guess 1:

Func connectbekleme()
    $x1 = 0
    $y1 = 0
    Do
        $arama3 = _ImageSearch("Images\connect.bmp", 1, $x1, $y1, 0)
        $arama3xb = _ImageSearch("Images\connect2.bmp", 1, $x1, $y1, 0)
        MsgBox(64, "Try Debugging!", "$arama3 value: " & $arama3 & @CRLF & "$arama3xb value: " & $arama3xb)
        If $arama3 = 1 Or $arama3xb = 1 Then
        Else
            Sleep(1000)
        EndIf
    Until $arama3 = 1
EndFunc  ;==>connectbekleme

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

example

this not runing not stop looping

do
$control1 = GUICtrlRead($checkbox1)
$control2 = GUICtrlRead($checkbox2)

if $control1 = 1 Or $control2 =1 then
MsgBox(64, "Try Debugging!", "You select 1 or 2")
else
end if
until $control1 =1 Or $control2 =1

this work

do
$control1 = GUICtrlRead($checkbox1)

if $control1 = 1 then
MsgBox(64, "Try Debugging!", "You select 1")
else
end if
until $control1 =1

whats wrong sorry bad my english.

Link to comment
Share on other sites

  • Moderators

example

this not runing not stop looping

do
$control1 = GUICtrlRead($checkbox1)
$control2 = GUICtrlRead($checkbox2)

if $control1 = 1 Or $control2 =1 then
MsgBox(64, "Try Debugging!", "You select 1 or 2")
else
end if
until $control1 =1 Or $control2 =1

this work

do
$control1 = GUICtrlRead($checkbox1)

if $control1 = 1 then
MsgBox(64, "Try Debugging!", "You select 1")
else
end if
until $control1 =1

whats wrong sorry bad my english.

Again, you're not posting code anyone can run.

Global $chkbox1, $chkbox2, $read1, $read2
GUICreate("Checkbox")

$chkbox1 = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20)
$chkbox2 = GUICtrlCreateCheckbox("CHECKBOX 2", 10, 40, 120, 30)

GUISetState()
Do
    $read1 = GUICtrlRead($chkbox1)
    $read2 = GUICtrlRead($chkbox2)
Until $read1 = 1 Or $read2 = 1 Or GUIGetMsg() = -3
MsgBox(64, "Info", "Checkbox 1 Checked = " & ($read1 = 1) & @CRLF & _
                    "Checkbox 2 Checked = " & ($read2 = 1))

Works fine.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...