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

FindToolType

Find the value of a ToolType variable.

Declaration

Source position: icon.pas line 237

function FindToolType(

  const ToolTypeArray: PPChar;

  const TypeName: PChar

):PChar;

Arguments

ToolTypeArray

  

A Pointer to an array of tool types.

TypeName

  

The name of the tooltype entry

Description

This function searches a tool type array for a given entry, and returns a pointer to that entry. This is useful for finding standard tool type variables. The returned value is not a new copy of the string but is only a pointer to the part of the string after TypeName.

The ToolTypeArray can be get from TDiskObject.do_Tooltypes via GetDiskObject()

Snippet

//Assume the tool type array has two strings in it:
//    "FILETYPE=text"
//    "TEMPDIR=:t"
FindToolType(toolTypeArray, 'FILETYPE'); // returns 'text'
FindToolType(toolTypeArray, 'filetype'); // returns 'text'
FindToolType(toolTypeArray, 'TEMPDIR');  // returns ':t'
FindToolType(toolTypeArray, 'MAXSIZE');  // returns nil
FindToolType(toolTypeArray, 'text');     // returns nil
FindToolType(toolTypeArray, ':t');       // returns nil

See also

FreeDiskObject

  

Free all memory in a Workbench disk object.

GetDiskObject

  

Read in a Workbench disk object from disk.

MatchToolValue

  

Check a tool type variable for a particular value.

PDiskObject

  


Documentation generated on: 2021-07-30