Method
GetTagsAssociatedWithTopicUnknown
I'm fairly new to HelpNDoc (working on an old version - 5).
From an existing script ( ExportHelpIdsandContexts.hnd.pas , provided with the installation ) I'm trying to get a list of the tags linked with each topic.
I thought HndTags.GetTagsAssociatedWithTopic(aTopicId) would get me through my task but if I try to build I get an error :
identifient non déclaré
GetTagsAssociatedWithTopic.
I was hoping to get a file with (Topic Caption | Help ID | Help Context | Tags)
aList.Add(Format('%s | %s | %d | %s', [
HndTopics.GetTopicCaption(aTopicId),
HndTopics.GetTopicHelpId(aTopicId),
HndTopics.GetTopicHelpContext(aTopicId),
HndTags.GetTagsAssociatedWithTopic(aTopicId)
]));
got me the error described in the previous section.
I was thinking about the returned type of the function and tried to find a way to cast the returned TStringList into a String, but couldn't do it.
Add on
Thanks for your answer. I dug up a little more still have a problem with TSTringDynArray.
If i dont define it, the error is "unknown type". Thanks to FreePascal i found out how it is supposed to be defined.
But of i define it, i get an erreur "Record required" for the following line
aTags:=HndTopicsTags.GetTagsAssociatedWithTopic(aTopicId);
So, i think i should have not "re"defined the TStringDynArray but i can't find out why it's not recognised by itself.
This code seems to have multiple problems:
According to HelpNDoc's API documentation, the
GetTagsAssociatedWithTopicmethod is part of theHndTopicsTagsobject. SoHndTags.GetTagsAssociatedWithTopicis wrong and should be replaced withHndTopicsTags.GetTagsAssociatedWithTopicHndTopicsTags.GetTagsAssociatedWithTopicreturns aTStringDynArraywhich is an array of string. It can't be used in the Format method using the%splaceholder. Instead, you should use a loop (for,whileorrepeat) to iterate over its items.