My Brain is fried trying to get this Loop to work.
The goal is read each line of the text file and find each line
that matches the SearchText using the TF_Find function
Then loading the Text file and reading each line,
cheicking for a match, it loops until
a match is found, it then parses the "FoundRows" values and
displays the Row number & Script title.
Then it should continue to read the next line/s in the text file
following the 1st match until it finds the next match,
then gets the next value of "FoundRows" and repeats this until all the matches are found.
Ther problem is the "Loop, parse, FoundRows, `, "
is not exiting after finding the "SearchText" match and
going to the "Loop, parse, A_LoopReadLine, `n`r " and
incrementing to the next line in the text file.
Instead it stays in the "FoundRows" loop & displays
All the lines containing the SearchText matches x times for each
FoundRow value found, then each Ttitle found.
This is part of a much larger script. Please DO NOT change the script
or it can impact other areas of the larger script.
other than to FIX the line/s when it's stuck in the Loop rather than
incrementing to the next line in the Text File & the next Row & Title
in the "FoundRows" loop.
Thanks for any help you can provide.
Have a Great Holiday and New Year.
Code:
; this text file only needs to be created once.
; It is a smalll sample of a significantly larger text file.
TFList =
(
Add Entry to List
Add File
AHK Running Scripts Restarter
API Lists + Code
Array MultiArray from MultiFiles
Array Pass to Function
Array Read Write
Array to INI
Auto-Insert Text with Tags in any Script
AutoComplete
AutoLookupDDL
Button Focus Send Click
CheckBox Run Programs
Checkbox Tabbed Tools
Class Get Control Class Function
Close All Group
Close All Windows
Close All Windows
Code Add Here
Color Set Color Background Transparent
ColorPicker Magnifier
ComboBox Fill Get Item
)
FileAppend, %TFList%, %A_ScriptDir%\FoundTitles.txt
SearchText = Color
F = %A_ScriptDir%\ScripletLibTitles.txt
FoundRows := TF_Find(F, 1,0, SearchText, 0, 0) ; Find all line numbers with the SearchText.
MsgBox % TF_Find(F, 1, 0, SearchText, 0, 0) ; result: - 0, 0 returns all results by line number
Loop, read, %F%
{
Loop, parse, A_LoopReadLine, `n`r
{
IfinString, A_LoopReadLine, %SearchText%
{
Loop, parse, FoundRows, `,
{
MsgBox, , FoundRows, %A_LoopField% is %A_LoopReadLine%
}
}
Else If A_LoopReadLine <> SearchText
Msgbox %A_LoopReadLine% <> %SearchText%
}
}
Return
ESC::ExitApp
#Include %A_ScriptDir%\TF.ahk ; version 3.1
; http://www.autohotkey.com/forum/topic46195.html TF.ahk Download
_________________
"Man's quest for knowledge is an expanding series whose limit is infinity"