Howdy all,
I'm looking for the most succinct way to code the following situation. I want to check a block of text to see if it contains either string A, string B or neither, and based upon the result go down one of two different paths, or just continue down the main path if nothing was true. I can accomplish this with the following:
Code: Select all
testlabel:
MsgBox, Case 1 path.
Return
testlabel2:
MsgBox, Case 2 path.
Return
testlabel3:
MsgBox, Continue main path
Return
+<::
If (clipboard ~= "case one")
GoTo testlabel
Else If (clipboard ~= "case 2")
GoTo testlabel2
MsgBox, Neither happened
Return
Code: Select all
testlabel:
MsgBox, Case 1 path.
Return
testlabel2:
MsgBox, Case 2 path.
Return
testlabel3:
MsgBox, Continue main path
Return
clipboard ~= "case 1" ? GoTo testlabel : clipboard ~= "case 2" ? GoTo testlabel2 : GoTo testlabel3