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

NextTagItem

Iterate through a tag list.

Declaration

Source position: utility.pas line 164

function NextTagItem(

  TagListPtr: PPTagItem

):PTagItem; overload;

function NextTagItem(

  var TagList: PTagItem

):PTagItem; overload;

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