Page 1 of 1

Is it a bug?

Posted: 27 Apr 2017, 08:41
by oldbrother
IfInstring cannot take "||" or "`|`|" as a parameter.
But InStr() can use it.

Test code:

Code: Select all

MyString=AAA,BBB,||,|CCC||,DDD

Loop Parse, MyString, `,
  IfInString,%A_LoopField%,||
  ;if InStr(A_LoopField,"||")
    Msgbox Found!  
Thanks!

Re: Is it a bug?

Posted: 27 Apr 2017, 08:45
by dsewq1LYJ
oldbrother wrote:IfInstring cannot take "||" or "`|`|" as a parameter.
But InStr() can use it.

Test code:

Code: Select all

MyString=AAA,BBB,||,|CCC||,DDD

Loop Parse, MyString, `,
  IfInString,%A_LoopField%,||
  ;if InStr(A_LoopField,"||")
    Msgbox Found!  
Thanks!

Code: Select all

MyString=AAA,BBB,||,|CCC||,DDD
Loop,Parse,MyString,`,
    IfInString,A_LoopField,||
        Msgbox Found!

Re: Is it a bug?

Posted: 27 Apr 2017, 08:47
by guest3456
1. If you're asking if it's a bug or not, you should be posting in Ask For Help

2. No, its not a bug. You're not using IfInString correctly. See the help page:

https://autohotkey.com/docs/commands/IfInString.htm
var
The name of the variable whose contents will be searched for a match.