Check a tool type variable for a particular value.
Source position: icon.pas line 360
function MatchToolValue( |
const typeString: pCHAR; |
const value: pCHAR |
):LongBool; |
const typeString: RawByteString; |
const value: pCHAR |
):Boolean; |
const typeString: pCHAR; |
const value: RawByteString |
):Boolean; |
const typeString: RawByteString; |
const value: RawByteString |
):Boolean; |
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.
typeString |
|
A ToolType value (as returned by FindToolType()) |
value |
|
You are interested if value appears in TypeString |
typeString |
|
A ToolType value (as returned by FindToolType()) |
value |
|
You are interested if value appears in TypeString |
typeString |
|
A ToolType value (as returned by FindToolType()) |
value |
|
You are interested if value appears in TypeString |
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. |
|
|
Case-insensitive string comparison. |