WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: MW4 on October 19, 2017, 11:53:31 AM

Title: Using a OR in a string test
Post by: MW4 on October 19, 2017, 11:53:31 AM
If I have code below such as this

if strsub(thisline,1,34) == "ABC"

And that works...how can I add a test such as this:

     if strsub(thisline,1,34) == "ABC" or "DEF"

I tried:
     if strsub(thisline,1,34) == "ABC"|"DEF"
and that didn't work

Title: Re: Using a OR in a string test
Post by: JTaylor on October 19, 2017, 11:59:05 AM
Use   ||

  if strsub(thisline,1,34) == "ABC"  ||   strsub(thisline,1,34) == "DEF"

Jim
Title: Re: Using a OR in a string test
Post by: MW4 on October 19, 2017, 12:04:04 PM
THANKS!!! That worked.