Executes a Help macro if a given marker exists. It uses the IsMark macro to make the test. You can also use a DLL function as a condition for this macro.
Syntax
IfThen(IsMark("marker-text"), "macro")
Parameter | Description |
marker-text | Text marker previously created by the SaveMark macro. The IsMark macro tests the marker you specify. If the marker value that the test returns is zero, the macro does not execute. If the value is something other than zero, the macro executes. The marker text must be enclosed in quotation marks. |
macro | Help macro or macro string that executes if the marker exists. The macro must be enclosed in quotation marks. Separate multiple macros in a string with semicolons (;). |
Example
The following macro jumps to the topic with the “man_mem” context string if the SaveMark macro has set a marker named Managing Memory:
IfThen(IsMark("Managing Memory"), "JI(`trb.hlp', `man_mem')")
Comments
You can use the IfThen macro to create many custom effects in your Help file. For example, you can use it to add a button to some topics and not have it appear in other topics. In the topic(s) where you want the button to appear, you create a macro footnote with the following sample macro string:
IfThen(Not(IsMark(`B')), "SaveMark(`B') : CreateButton(`misc_btn', `&Test', `JumpContents(`pmcd.hlp')')")
In the topics where you don’t want the button to appear, you create a macro footnote with this macro string:
IfThen(IsMark(`B'), "DeleteMark(`B') : DestroyButton(`misc_btn')")
If a topic does not have this footnote, it will have the same button characteristics as the previously viewed topic.
See Also
DeleteMark, GotoMark, IfThenElse, IsMark, Not, SaveMark