Hi everyone.
My programming skills are quite rusty and i am trying to maintain and modify some scripts used where i work.
I'm fairly new to this software called HelpnDoc.
I'm trying to be able to export a .twt made of the list of the topics with their tags.
With the help on another forum i found the a function which should be what i'm loonking for.
GetTagsAssociatedWithTopic(const aTopicId: string): TStringDynArray;
Problem : the type.
Wheren i try in the "var" section something like
TagsArray:TStringDynArray
Unknown type : TStringDynArray
I found something here
https://www.freepascal.org/docs-html/rtl/types/tstringdynarray.html but when i try to use it
for
aTags:=HndTopicsTags.GetTagsAssociatedWithTopic(aTopicId);
My whole code :
type
TStringDynArray = array of String;
const
OUTPUT_FILE = 'C:\topics.txt';
var
aTopicId: string;
aTags: TStringDynArray;
aTagsString: string;
i : integer;
j:integer ;
aList: TStringList;
begin
aList := TStringList.Create;
aList.Add('Topic Caption | Help ID | Help Context | Tags');
aList.Add('---------------------------------------------');
try
aTopicId := HndTopics.GetTopicFirst();
while aTopicId <> '' do
begin
aTags:=HndTopicsTags.GetTagsAssociatedWithTopic(aTopicId);
for i:=0 to aTags.count-1 do
Begin
aTagsString:= aTagsString + aTags[i];
end;
// Add the topic to the list
aList.Add(Format('%s | %s | %d | %s ', [
HndTopics.GetTopicCaption(aTopicId),
HndTopics.GetTopicHelpId(aTopicId),
HndTopics.GetTopicHelpContext(aTopicId),
aTagsString
]));
aTags.free;
// Get next topic
aTopicId := HndTopics.GetTopicNext(aTopicId);
end;
aList.SaveToFile(OUTPUT_FILE);
finally
aList.Free;
end;
end.