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

GetTagData

Obtain the data corresponding to a tag.

Declaration

Source position: utility.pas line 212

function GetTagData(

  TagValue: LongWord;

  Default: NativeUInt;

  const TagList: PTagItem

):NativeUInt;

Arguments

TagValue

  

A tag value to search for

Default

  

Value to be returned if tagValue is not found.

TagList

  

The tag list to search.

Function result

The ti_Data value for the first matching TagItem, or 'default' if a ti_Tag matching 'Tag' is not found.

Description

Searches a tag list for a matching tag, and returns the corresponding ti_Data value for the TagItem found. If no match is found, this function returns the value passed in as 'default'.

// Find out the value for the WA_Left tag
window^.Left := GetTagData(WA_Left, 320, wintags);

If the input TagList doesn't exist (e.g. for some reason equals nil), then the return value will be nil. This way you can check for broken code, whereas returing the default would allow code that is possibly buggy to still seem to work. (Until you tried to do anything special at least).

See also

FindTagItem

  

Scan a tag list for a specific tag.

PackBoolTags

  

Builds a "flag" word from a tag list

NextTagItem

  

Iterate through a tag list.


Documentation generated on: 2021-07-30