Jump to content
Sign in to follow this  
RZLucian0127

[HELP] If condition pls help

Recommended Posts

RZLucian0127

If ($chkScreen = 0 and $chkCursor = 0) Then

$chk2 = 0

ElseIf ($chkScreen = 1 and $chkCursor = 1) Then

$chk2 = 1

EndIf

Guys please help with that code i'm so confuse in AutoIT script ^__^ pls help thanks in advance guyz.. i don't know where is the error, because it has no error message but there is no effect huhuhu Y__Y

Share this post


Link to post
Share on other sites
GEOSoft

If ($chkScreen = 0 and $chkCursor = 0) Then

$chk2 = 0

ElseIf ($chkScreen = 1 and $chkCursor = 1) Then

$chk2 = 1

EndIf

Guys please help with that code i'm so confuse in AutoIT script ^__^ pls help thanks in advance guyz.. i don't know where is the error, because it has no error message but there is no effect huhuhu Y__Y

MsgBox(0, "Test", "The value of $chk2 is " & CheckScreen())

Func CheckScreen()
If ($chkScreen = 0 and $chkCursor = 0) Then
  $chk2 = 0
ElseIf ($chkScreen = 1 and $chkCursor = 1) Then
  $chk2 = 1
Else
  $chkScreen = 2
EndIf
  Return $chk2
EndFunc

I suspect that what you are really looking for is

If ($chkScreen = 0 and $chkCursor = 0) Then
  $chk2 = 0
Else
  $chk2 = 1
EndIf

Or maybe

If ($chkScreen = 0 and $chkCursor = 0) Then
  $chk2 = 0
ElseIf ($chkScreen = 1 OR $chkCursor = 1) Then
  $chk2 = 1
EndIf

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
BrettF

Lets see...

$chkCursor = 0
$chkScreen = 0
$chk2 = -1
If ($chkScreen = 0 And $chkCursor = 0) Then
    $chk2 = 0
ElseIf ($chkScreen = 1 And $chkCursor = 1) Then
    $chk2 = 1
EndIf
$Msg = "Case 1-" & @CRLF
$Msg &= "$chkcursor = " & $chkCursor & @CRLF
$Msg &= "$chkscreen = " & $chkscreen & @CRLF
$Msg &= "$chk2 = " & $chk2
MsgBox (0, "", $Msg)

$chkCursor = 1
$chkScreen = 1
$chk2 = -1
If ($chkScreen = 0 And $chkCursor = 0) Then
    $chk2 = 0
ElseIf ($chkScreen = 1 And $chkCursor = 1) Then
    $chk2 = 1
EndIf
$Msg = "Case 2-" & @CRLF
$Msg &= "$chkcursor = " & $chkCursor & @CRLF
$Msg &= "$chkscreen = " & $chkscreen & @CRLF
$Msg &= "$chk2 = " & $chk2
MsgBox (0, "", $Msg)

Also, try having a look at the <> operators... :P

Share this post


Link to post
Share on other sites
GEOSoft

I'm going to have to start calling you "Tricky Bert" or maybe "The Tricky Aussie". :P

Edit: That's what you get for sleeping with my sister.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
BrettF

I'm going to have to start calling you "Tricky Bert" or maybe "The Tricky Aussie". :P

Edit: That's what you get for sleeping with my sister.

I'm not sure which one your sister was... Was it last night or this morning... ;) JKS! Why would you call me tricky :)

Share this post


Link to post
Share on other sites
RZLucian0127

I'm not sure which one your sister was... Was it last night or this morning... :P JKS! Why would you call me tricky ;)

ehehe.. btw, thanks guyz ^__^ i got it

Share this post


Link to post
Share on other sites
GEOSoft

ehehe.. btw, thanks guyz ^__^ i got it

Glad to be of service sir and welcome to the land of AutoIt.

BTW: Not everyone is crazy around here. I'm OK but watch out for Bert. He'll sleep with anybodys sister or the sister of a snake for that matter.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
BrettF

Glad to be of service sir and welcome to the land of AutoIt.

BTW: Not everyone is crazy around here. I'm OK but watch out for Bert. He'll sleep with anybodys sister or the sister of a snake for that matter.

You never been close to a snake until... Woooooo!

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  

×