When it comes time to output an ALink button for a topic, the following macro is invoked to process list variable $$AlinkKeys (see §18.7.5.1 Creating a list of ALink keywords from paragraphs) and add each keyword to the button object:
[ALinkButton] <$_if (Nkeys > 0)> <$ALinkButtonStart><$$ALinkParamNum=1>\ <$_repeat ($$Nkeys)>\ <$$ALinkParamText=$$ALinkKeys[$$ALinkParamNum]>\ <$$ALinkParamNum++><$ALinkButtonParam>\ <$_endrepeat>\ <$ALinkButtonEnd><$$Nkeys=0>\ <$_endif>
[AlinkButton] uses two additional macro variables:
$$ALinkParamNum is initialized to 1, and then incremented before each keyword parameter is added to the button object, because the "ItemN" keyword parameters for the button object start with N=2, not N=1 (see §18.7.4 Rolling your own macros for ALink jumps in HTML Help).
[AlinkButton] invokes three other macros to build the button object:
Start of button object: [ALinkButtonStart]
Keyword parameters: [ALinkButtonParam]
End of button object: [ALinkButtonEnd]
The first part of the ALink button object is straightforward, and uses the same code described in §18.7.4 Rolling your own macros for ALink jumps in HTML Help:
[ALinkButtonStart] <object id="hhctrl" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width="100" height="100"> <param name="Command" value="ALink"> <param name="Button" value="Text:Related topics"> <param name="Flags" value="1"> <param name="Item1" value="">
Next come the "Item2" through "ItemN" parameters, which are added to the button object one by one, as list variable $$AlinkKeys is processed:
[ALinkButtonParam] <param name="Item<$$ALinkParamNum>" value="<$$ALinkParamText>">
The last piece ends the button object:
[ALinkButtonEnd] </object>
This version of the [AlinkButton] macro assumes that each item in the $$ALinkKeys list contains a single ALink keyword. To process a list that contains multiple keywords per list item, you would need a slightly more complex version; see §18.7.5.5 Including multiple ALink keywords in a paragraph or marker.