Code: Select all
GuiControlGet, search, , guisearch
if (search != guisearch)
Goto Searcher
Code: Select all
Searcher:
Gui, Submit, NoHide
LV_Delete()
if not (guisearch = "")
{
Loop, Read, % RadioCMYK ? CMYK : LabCh ; checks which radio button is selected to determine which database to load. Defaults to CMYK
{
GuiControlGet, search, , guisearch ; every iteration of the loop checks the user input to see if it has changed
if (search != guisearch) ; I don't know why this doesn't always pass, but it works wicked great
Goto Searcher
search := Format("{:T}", search) ; capitalize first letter of the user input to match the database. Every first letter in the database is capitalized without exception.
Loop, Parse, A_LoopReadLine, "`t"
{
if (A_Index == 2) AND (SubStr(A_LoopField, 1, StrLen(search)) == Format("{:T}", search)) ; looks into the second field (the name), capitalizes the first letter of user input, and checks for match
{
c := StrSplit(A_LoopReadLine, "`t")
LV_Add("",c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10]) ; the database is formatted to lay out perfectly into the listview columns
c :=
break
}
}
}
}