You can define any number of your own variables to use in your project. These user-defined variables are stored with your project, which means that they are only available to the project in which they are defined. However, you can transfer variables between projects with the Export and Import functions (see below).
User-defined variables can be used almost everywhere in your projects: In topics and headers, the Table of Contents, keywords, image captions, link captions, macros, scripts, HTML code objects, HTML templates and PDF templates. See the other topics in this section for details on using variables in these locations.
See Inserting variables in topics and Inserting variables in other locations for details on how to use variables in your projects.
You can define two different types of variables: Text variables and HTML variables. Both types have no effective length limit (theoretically you could enter up to 2 gigabytes of text). See The power of editable variables for more details on using HTML variables. Plain-text variables: Plain-text variables contain text only. The text is inserted as plain text wherever you use the variable. You can use them anywhere where variables are supported. HTML variables: HTML variables contain HTML code. They are designed primarily for use in HTML templates and HTML code objects. If you use an HTML variable anywhere else (for example in a topic in the Help & Manual editor) only the text portion of the variable value will be inserted. If there is no text portion nothing will be inserted. |
You don't need to worry about case, the variable name will be converted to all upper case automatically.
There is effectively no limit to the amount of text you can enter – you are unlikely to be able to enter more than 2 gigabytes of text in the Value column! |
Exactly the same variable name syntax is used for variables in all parts of your projects: <%VARIABLENAME%>
<%VARIABLE NAME WITH SPACES%> |
OR:
The second option only works with variables entered with Insert > Text Variable. Variables typed in manually are not highlighted and you cannot display the variables list by double-clicking on them. |
You can use these features to copy variables between projects and to define variables in a text editor and then load them into your project. (This can be easier than defining a lot of long variables directly in Help & Manual.) Exporting user-defined variables:
Importing user-defined variables from a file:
VARIABLENAME1=Variable value One variable per line, variable name all in capital letters, no spaces on either side of the = character, no quotes. You can also enter HTML code for HTML variables, of course.
Use the Export function (see above) to see an example of the necessary format and the syntax of the file. Importing user-defined variables from another project: You can also import all the user-defined variables from another Help & Manual project. To do this just click on Copy properties from... at the bottom of the Text Variables editing window and select the project you want to import the variables from. This will overwrite the variables in the current project. If you want to merge the variables from another project you must export them to a text file and then import them from the text file (see above). |
See also:
Variables and Conditional Output (Reference)
Page url: http://www.helpandmanual.com/help/index.html?hm_working_variables_userdef.htm