Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add multiple search words

Status
Not open for further replies.

Kim296

MIS
Aug 24, 2012
98
US
I asked a previous question about highlighting search words using a parameter search word. I was able to find the following code which works perfectly for highlighting my parameter search word as a formula ({@SEARCH1}), but I have 10 parameter search words that I've converted to formula's ({@Search1}, {@Search2}, {@Search3), etc...). How can I incorporate the other Search words into this code, so that any/all search word used will highlight?

This code does work fine using one search word:

Shared StringVar SearchText := {@SEARCH1} ;
StringVar Htm1 := "<font color=#FF0066>";
StringVar Htm2 := "<b>";
StringVar Htm5 := "</b>";
StringVar Htm6 := "</font>";
StringVar Result := "";
StringVar Temp := "";
NumberVar Start := 1;
NumberVar Ln := Len(SearchText);
NumberVar Loc := Instr({@NOTES}, SearchText);
While Loc > 0 Do (
Temp := Mid({@NOTES}, Start, Loc - Start) + Htm1 & Htm2 + Mid({@NOTES}, Loc, Ln) & Htm5 & Htm6;
Result := Result + Temp;
Start := Loc + Ln;
Loc := Instr(Start, {@NOTES}, SearchText);
);
Temp := Mid({@NOTES}, Start);
Result := Result + Temp;
Result
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top