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

NextTagItem

Iterate through a tag list.

Declaration

Source position: utility.pas line 214

function NextTagItem(

  var Item: PTagItem

):PTagItem; overload;

function NextTagItem(

  ItemPtr: PPTagItem

):PTagItem; overload;

Arguments

Item

  

Doubly-indirect reference to a TagItem structure. The pointer will be changed to keep track of the iteration.

Function result

Each TagItem in the array or chain of arrays that should be processed according to system tag values is returned in turn with successive calls.

Description

Iterates through a tag list, skipping and chaining as dictated by system tags. TAG_SKIP will cause it to skip the entry and a number of following tags as specified in ti_Data. TAG_IGNORE ignores that single entry, and TAG_MORE has a pointer to another array of tags (and terminates the current array!). TAG_DONE also terminates the current array. Each call returns either the next tagitem you should examine, or nil when the end of the list has been reached.

procedure Iterate(tags: PTagItem);
var
  tag: PTagItem;
begin
  tag := NextTagItem(tags);
  while tag <> nil do
  begin
    case tag^.ti_Tag of
      TAG1: ...
      TAG2: ...
    else ...
    end;
    tag := NextTagItem(tags);
  end;
end;

See also

GetTagData

  

Obtain the data corresponding to a tag.

PackBoolTags

  

Builds a "flag" word from a tag list

FindTagItem

  

Scan a tag list for a specific tag.


Documentation generated on: 2021-07-30