I found that, there is no way to add caption and data-related information when we are creating the keyword.
function SetKeywordCaption(const aKeywordId: string; const sNewCaption: string): string;
function AssociateTopicWithKeyword(const aTopicId: string; const aKeywordId:string): Boolean;
In order to edit the keyword caption, I have to use the function SetKeywordCaption, which needs keyword id. For that, I get the keyword list using function GetKeywordList(); and it returns an array. I get the last element numeric id from that array which is a newly inserted keyword. Then, access the aKeywordList array using last element array id and add .Id which will retrieve id of that keyword. Then, Using keyword id with function SetKeywordCaption, able to edit keyword caption.
In order to add data-related information, I have use function AssociateTopicWithKeyword which needs the topic id and keyword id. I get topic list using function GetTopicList. I get topic id of five(topic_array[(5-1)].ID) and sixth topic(topic_array[(6-1)].ID). Then, have used function AssociateTopicWithKeyword to link keyword to topics.
Call helpndoc function:
Object.function
ex (HndKeywords.CreateKeyword;)
var new_keyword :=HndKeywords.CreateKeyword;
var aKeywordList =HndKeywords.GetKeywordList() ;
//get keyword added last
var newlyaddedkeyword_array_id =length(aKeywordList) - 1 ;
var newlyaddedkeyword__id =aKeywordList[newlyaddedkeyword_array_id].Id;
var edit_keywordcaption =HndKeywords.SetKeywordCaption(newlyaddedkeyword__id, "Edited keyword");
var topic_array=HndTopics.GetTopicList;
var keywordtopics =HndTopicsKeywords.AssociateTopicWithKeyword(topic_array[4].ID,newlyaddedkeyword__id);//parameter : topic id and keyword id
var keywordtopics2 =HndTopicsKeywords.AssociateTopicWithKeyword(topic_array[5].ID,newlyaddedkeyword__id);
See: HndKeywords - Properties and methods for keywords