IniRead, Loop, and IfInstring help please
Posted: 22 Oct 2017, 14:55
Hi All,
I have a very small amount of experience with IniRead, and even less with Loops. This is my first time using IfinString, but it seems like the following script should work.
In the same folder, I have a text file "LocationsList.txt" with the following (ini-formatted) content.
I expected it to yield a message box with "Yes found office," but instead, I get "No, not found."
Any thoughts on my error?
I have a very small amount of experience with IniRead, and even less with Loops. This is my first time using IfinString, but it seems like the following script should work.
Code: Select all
#NoEnv
#SingleInstance force
;#################################
Haystack := "meeting for Jon Doe in RR tomorrow."
;===========
IniRead, AllLocations, LocationsList.txt ;Gets `n-delimited list from ini file.
Loop, Parse, AllLocations, `n,`r ; Parses list.
{
IfInString, Haystack, %A_LoopField%
{
MsgBox, Yes found %A_LoopField%
Return
}
Else
MsgBox, No, not found.
Return
}
Code: Select all
[myLocations]
1=office
Any thoughts on my error?