Hello all, I cannot seem to get this conditional to work. I've tried %%, == , "", "%%", `%`%, etc around the var but it won't work. I've noticed it will run without any ORs in the expression, but is there really no way for me to quickly check to see if it's one of these strings in the conditional expression?!
if (Legal = "Sole" || "Sol" || "Sol Prop" || "SP" || "DBA" || "Sole Proprietor")
{
MouseClick, Left, IndividualX, IndividualY, 1
}
else if (Legal = "C" || "C Corp" || "C Corporation")
{
MouseClick, Left, CorporationX, CorporationY, 1
}
else if (Legal = "S" || "S Corp" || "S Corporation")
{
MouseClick, Left, ScorpX, ScorpY, 1
}
else if (Legal = "LLC" || "Limited Liability Corporation")
{
MouseClick, Left, LLCx, LLCy, 1
}
else if (Legal = "Part" || "P" || "Partner" || "Partnership")
{
MouseClick, Left, PartnerX, PartnerY, 1
}
Else if (Legal = "Joint" || "Joint Venture" || "Like, when is it ever this?")
{
MouseClick, Left, JointX, JointY, 1
}
Else
{
MouseClick, Left, NonProfX, NonProfY, 1
}
Thanks for the help!
Jimi
|| Operator not working for strings in conditional Topic is solved
Re: || Operator not working for strings in conditional
Hello! Welcome to the forum. I moved your post to the Ask for Help section.
You had a great attempt! You just need to evaluate the condition each time.
Also, please place your code in
You had a great attempt! You just need to evaluate the condition each time.
Code: Select all
if (Legal == "Sole" || Legal == "Sol" || Legal == "Sol Prop" ...) ; and so on
Code: Select all
blocks when posting.
Re: || Operator not working for strings in conditional
I can infer from your code it was intuitive to present one variable and then name the possible things it could match. In this situation, you may be interested in If var in matchlist.
Re: || Operator not working for strings in conditional
+1. I keep forgetting about that one.
Who is online
Users browsing this forum: doodles333 and 343 guests