Hello,
I have a notes field that contains multiple lines of text. I would like to highlight red certain specific words when present, not the whole field. I am in the text interpretation field and have used the following formula which I have found on other postings. In this example I want to highlight the word PASSED
Shared StringVar SearchText := "PASSED";
StringVar Htm1 := "<font color=#800000>";
StringVar Htm2 := "</font>";
StringVar Result := "";
StringVar Temp := "";
NumberVar Start := 1;
NumberVar Ln := Len(SearchText);
NumberVar Loc := Instr({MPD_CASE_TYPE_LIST.MPD_MONO}, SearchText);
While Loc > 0 Do (
Temp := Mid({MPD_CASE_TYPE_LIST.MPD_MONO}, Start, Loc - Start) + Htm1 + Mid({MPD_CASE_TYPE_LIST.MPD_MONO}, Loc, Ln) & Htm2;
Result := Result + Temp;
Start := Loc + Ln;
Loc := Instr(Start, {MPD_CASE_TYPE_LIST.MPD_MONO}, SearchText);
);
Temp := Mid({MPD_CASE_TYPE_LIST.MPD_MONO}, Start);
Result := Result + Temp;
Result
After trying to save I get the notice formula result must be a number. This happens in other attempts where I have tried other code. Any idea as to what I'm doing wrong?
I have a notes field that contains multiple lines of text. I would like to highlight red certain specific words when present, not the whole field. I am in the text interpretation field and have used the following formula which I have found on other postings. In this example I want to highlight the word PASSED
Shared StringVar SearchText := "PASSED";
StringVar Htm1 := "<font color=#800000>";
StringVar Htm2 := "</font>";
StringVar Result := "";
StringVar Temp := "";
NumberVar Start := 1;
NumberVar Ln := Len(SearchText);
NumberVar Loc := Instr({MPD_CASE_TYPE_LIST.MPD_MONO}, SearchText);
While Loc > 0 Do (
Temp := Mid({MPD_CASE_TYPE_LIST.MPD_MONO}, Start, Loc - Start) + Htm1 + Mid({MPD_CASE_TYPE_LIST.MPD_MONO}, Loc, Ln) & Htm2;
Result := Result + Temp;
Start := Loc + Ln;
Loc := Instr(Start, {MPD_CASE_TYPE_LIST.MPD_MONO}, SearchText);
);
Temp := Mid({MPD_CASE_TYPE_LIST.MPD_MONO}, Start);
Result := Result + Temp;
Result
After trying to save I get the notice formula result must be a number. This happens in other attempts where I have tried other code. Any idea as to what I'm doing wrong?