Unit 'icon' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#morphunits]

MatchToolValue

Check a tool type variable for a particular value.

Declaration

Source position: icon.pas line 360

function MatchToolValue(

  const typeString: pCHAR;

  const value: pCHAR

):LongBool;

function MatchToolValue(

  const typeString: RawByteString;

  const value: pCHAR

):Boolean;

function MatchToolValue(

  const typeString: pCHAR;

  const value: RawByteString

):Boolean;

function MatchToolValue(

  const typeString: RawByteString;

  const value: RawByteString

):Boolean;

Arguments

typeString

  

A ToolType value (as returned by FindToolType())

value

  

You are interested if value appears in TypeString

Function result

True if the value was in TypeString else False.

Arguments

typeString

  

A ToolType value (as returned by FindToolType())

value

  

You are interested if value appears in TypeString

Arguments

typeString

  

A ToolType value (as returned by FindToolType())

value

  

You are interested if value appears in TypeString

Arguments

typeString

  

A ToolType value (as returned by FindToolType())

value

  

You are interested if value appears in TypeString

Description

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

See also

FindToolType

  

Find the value of a ToolType variable.

Stricmp

  

Case-insensitive string comparison.


Documentation generated on: 2021-07-30