.CSH()

Method to get and set the context sensitivity for a topic.

The method .CSH() is located in the file topic.jsxinc.

Usage

To get the topic id's and Map numbers assigned to a topic:

var tpmngr = currentProject.TopicManager;
for(var i = 1; i<=tpmngr.count; i++) {
  var topic = tpmngr.item(i);
  var topiccsh = topic.CSH();
}

To assign a topic id and a Map number to a topic:

topic.CSH("TopicId", 1);

To check that a topic has context sensitive help assigned:

var topiccsh = topic.CSH();
if(is_array(topiccsh))
  //Topic has CSH
else
  //Topic does not have CSH

Note:

  • When the topic id and the Map number are not yet added to the project, the method will add the topic id and the Map number to the project.
  • When only the topic id or the Map number exist in the topic, the method cannot assign the CSH to the topic.
  • The method does not check whether the given topic id and map number are mapped to each other. The method assumed you created both id's correctly.

Parameters

When parameters are omitted, the method returns the context sensitivity for the topic.

Parameter Data type Required Description
topicid String   The topic id to assign to the topic.
mapnumber String or Number Required when topicid is set. The map number to assign to the topic.

Return values

Value Meaning
array The context sensitivity of the topic.
true Id's were assigned to the topic.
false This topic has not context sensitivity or could not assing context sensitivity to the topic.

Structure of returned array with context

This paragraph describes the structure of the array returned by the method .CSH().

When the return value of the paragraph is false, there is no context sensitivity assigned to the topic. When there is context sensitivity assigned, an array with the following structure is returned:

- Numeric array key
|- CSHTopicidKey
|- CSHMapnumberKey

Each numberic key in the array is an embedded array. You use global variables to get the desired key: