Check a tool type variable for a particular value.
Source position: icon.pas line 238
function MatchToolValue( |
const TypeString: PChar; |
const Value: PChar |
):SmallInt; |
TypeString |
|
A ToolType value (as returned by FindToolType()) |
Value |
|
You are interested if value appears in TypeString |
True if the value was in TypeString else False.
MatchToolValue is useful for parsing a tool type value for a known value. It knows how to parse the syntax for a tool type value (in particular, it knows that '|' separates alternate values). Note that the parsing is case insensitive.
Snippet
//Assume there are two type strings: type1 := 'text'; type2 := 'a|b|c'; MatchToolValue(type1, 'text'); // returns True MatchToolValue(type1, 'TEXT'); // returns True MatchToolValue(type1, 'data'); // returns False MatchToolValue(type2, 'a'); // returns True MatchToolValue(type2, 'b'); // returns True MatchToolValue(type2, 'd'); // returns False MatchToolValue(type2, 'a|b'); // returns False
|
Find the value of a ToolType variable. |