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

MatchToolValue

Check a tool type variable for a particular value.

Declaration

Source position: icon.pas line 230

function MatchToolValue(

  const TypeString: PChar;

  const Value: PChar

):SmallInt;

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.

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