Sign in to follow this  
Followers 0
AustrianOak

Can my Case statement contain AND?

14 posts in this topic

Can I format my case statement like this without getting an error:

Case $msg = $pic1 AND $pic2

My goal is to check if a picture is clicked and also if a function has been "run through" before I want it to go to that certain Case statement.

I am extremely stumped on this but I know what I want to do.

Can this be accomplished?

Share this post


Link to post
Share on other sites



well... did "You" try it??

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

well... did "You" try it??

8)

lol... he did say he was stumped...

msg = x and msg = y


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.

Share this post


Link to post
Share on other sites

Ahh... thank you Smoke_N!

Share this post


Link to post
Share on other sites

lol... he did say he was stumped...

msg = x and msg = y

If you want to detect a pic has been click and some other condition has occurred then

$msg = x and $msg = y

will never work unless x and y are the same because $msg will either be one or the other.

Select
  Case $msg = $pic1 And $functionrun = true

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

If you want to detect a pic has been click and some other condition has occurred then

$msg = x and $msg = y

will never work unless x and y are the same because $msg will either be one or the other.

Select
  Case $msg = $pic1 And $functionrun = true
Don't think I need a lesson on what would or wouldn't work... I only showed the OP how to use an And statement.

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.

Share this post


Link to post
Share on other sites

Don't think I need a lesson on what would or wouldn't work

you're right, you need a lesson on how to use sarcasm more effectively.

Share this post


Link to post
Share on other sites

you're right, you need a lesson on how to use sarcasm more effectively.

Sad comment. You are not very smart. You already seemed to have reached the smartass grade. Bye. :)

Share this post


Link to post
Share on other sites

Don't think I need a lesson on what would or wouldn't work... I only showed the OP how to use an And statement.

Please don't think I was trying to give you a lesson SmOke_N, my post was not intended for you. I thought, since the OP asked the question he did, that I should point out that he could not actually do, literally, what you posted. I'm sorry if I offended you; I do not know as much as you do and I doubt anyone thinks otherwise.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

If you want to detect a pic has been click and some other condition has occurred then

$msg = x and $msg = y

will never work unless x and y are the same because $msg will either be one or the other.

Select
  Case $msg = $pic1 And $functionrun = true
So you mean to say the following isn't true?

$len = StringLen("bob")
$rnd = Random(1, 5, 1)
...
Case $msg = $len AND $msg = $rnd
...

:) ???

Edited by aslani

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Share this post


Link to post
Share on other sites

So you mean to say the following isn't true?

$len = StringLen("bob")
$rnd = Random(1, 5, 1)
...
Case $msg = $len AND $msg = $rnd
...

:) ???

I didn't say that and I don't see how you decided I did. I said that unless the two values are the same, but maybe I should have said unless the three values are the same. This would be the same as your version

Case $rnd = $len And $msg = $len

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Sad comment. You are not very smart. You already seemed to have reached the smartass grade. Bye. :)

Why are you telling me Bye? You didn't think I was going to get banned for a comment like that did you?

Share this post


Link to post
Share on other sites

Please don't think I was trying to give you a lesson SmOke_N, my post was not intended for you. I thought, since the OP asked the question he did, that I should point out that he could not actually do, literally, what you posted. I'm sorry if I offended you; I do not know as much as you do and I doubt anyone thinks otherwise.

I could have misinterpreted it, the fact that you "quoted" me without any iteration to the OP is what led me to believe it.

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.

Share this post


Link to post
Share on other sites

you're right, you need a lesson on how to use sarcasm more effectively.

If I was trying to be sarcastic, maybe I'd take that lesson.

Why are you telling me Bye? You didn't think I was going to get banned for a comment like that did you?

No, but you aren't earning any "help me" brownie points either. I will indeed avoid any further contact with you and or your posts for help, and encourage others to do the same.


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.

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