##### 18.7.5.5 Including multiple ALink keywords in a paragraph or marker

An enhanced version of the [ALinkButton] macro (see §18.7.5.3 Building an ALink button object from an ALink keyword list) parses each $$AlinkKeys list item for multiple ALink keywords, allowing you to include several keywords (separated by semicolons) in each ALinkTarget paragraph or Subject marker.

This version of the [ALinkButton] macro uses two additional macro variables:

$$ALinkKeyItem | Counts $$AlinkKeys list items (while $$ALinkParamNum counts keywords and labels the button-object keyword parameters, as before).
$$ItemContent | Holds a copy of each potentially multiple-keyword list item for chopping into individual ALink keywords.

This button macro invokes the same [ALinkButtonStart], [ALinkButtonParam], and [ALinkButtonEnd] macros described in §18.7.5.3 Building an ALink button object from an ALink keyword list:

    [ALinkButton]
    <$_if (Nkeys > 0)>
      <$ALinkButtonStart><$$ALinkKeyItem=1><$$ALinkParamNum=1>\
      <$_repeat ($$Nkeys)>\
        <$$ALinkParamText=$$ALinkKeys[$$ALinkKeyItem]>\
        <$$ALinkKeyItem++><$$ItemContent=$$ALinkParamText>\
        <$_while ($$ItemContent contains ";")>\
          <$$ALinkParamText=($$ItemContent before ";")>\
          <$$ALinkParamNum++><$ALinkButtonParam>\
          <$$ItemContent=($$ItemContent after ";")>\
          <$_endwhile>
        <$$ALinkParamText=$$ItemContent><$ALinkButtonParam>\
        <$_endrepeat><$ALinkButtonEnd><$$ALinkParamCount=0>\
      <$_endif>

See §37.6.4.3 Using loop structures for an explanation of loop controls $_repeat and $_while.

See §37.6.5 Specifying substrings in expressions for an explanation of string operators contains, before, and after.

Previous Topic: 18.7.5.4 Positioning the ALink button in each HTML Help topic

Next Topic: 18.7.6 Creating buttons for other types of related-topic links

Parent Topic: 18.7.5 Using the same format for ALink keywords and jumps

Sibling Topics:

18.7.5.1 Creating a list of ALink keywords from paragraphs

18.7.5.2 Initializing the ALink keyword list counter

18.7.5.3 Building an ALink button object from an ALink keyword list

18.7.5.4 Positioning the ALink button in each HTML Help topic