Hi Guys,
I am using a few scripts at the moment that use Instr to determine if there is a phrase in the string, and then to do something with that string, so e.g. If the String contains X and Y then do Z
I am sure it is simple, but how can i do an instr where only one condition exists, e.g. the string contains X but not Y, then does Z.
This is an example of one of my current script sections:
If Instr(1,data,"ALERT",1) > 0 and Instr(1,data,"[BEUP]",1) > 0 then
'do stuff
End If
How can I set it so that in this example, if the string contains [BEUP] but not ALERT then to 'do stuff
Ideally id like to be able to have three conditions eventually,
String contains both X + Y
String Contains Only X
String Contains Neither X or Y
Thanks
I am using a few scripts at the moment that use Instr to determine if there is a phrase in the string, and then to do something with that string, so e.g. If the String contains X and Y then do Z
I am sure it is simple, but how can i do an instr where only one condition exists, e.g. the string contains X but not Y, then does Z.
This is an example of one of my current script sections:
If Instr(1,data,"ALERT",1) > 0 and Instr(1,data,"[BEUP]",1) > 0 then
'do stuff
End If
How can I set it so that in this example, if the string contains [BEUP] but not ALERT then to 'do stuff
Ideally id like to be able to have three conditions eventually,
String contains both X + Y
String Contains Only X
String Contains Neither X or Y
Thanks
Comment