Keywords that can be used between QUESTION...ANSWER

You can use the following keywords between QUESTION…ANSWER.

ID keyword

ID ("string, determining the ID")

The keyword ID gives you the possibility to assign identification to a question. The identification is used by the keywords SHOW and SHOWNOT to determine the question that shows or hides the group and to identify individual questions. The use of the keyword ID is mandatory when the ID keyword is used on the FORM statement.

LEN keyword

LEN (maximum length of answer)

The keyword LEN gives you the possibility to set a maximum length for an answer. If the answer that the user has to provide is of type TEXT, the argument to LEN is a number between 1 and 65535. The value determines the total amount of positions for the answer. If the answer is of type NUMBER, the argument to LEN consists of two numbers where the first is the maximum number of digits and the second is the number of decimals. These two numbers are separated by a space. For example, LEN (7 3) indicates a number with three decimal places and four integral digits.

If the user does not enter decimal digits, they are still considered to be present. For example, when LEN (7 3) is specified, such answer as "1234" is interpreted as "1234.000," consisting of seven digits with three decimal positions. The total number of digits should be between 1 and 15.

For answers of type TEXT, the default length is LEN (125). For answers of type NUMBER, the default length is LEN (15 3).

LEN is ignored if either of the keywords DATE or TIME is used.

DFT keyword

DFT default answer

The keyword DFT allows to provide a default answer to a question. This default answer needs to be of the same TYPE as the variable, ARRAY, or an ARRAY element. The default answer is displayed when the Form is loaded. The default answer must be a valid answer to the question and must therefore appear in the list with possible answers when the keyword VALUES is used.

DFT should be an ARRAY if the keyword VALUES or VIEW has been used to provide possible answers (or Text Blocks) and the keyword MULTISELECT has been used to indicate that the user can select more than one answer (or Text Block) from the list. For an EDITABLE_TEXTBLOCK question, DFT should be either a reference to a KCM Designer Text Block or a Text Block reference that was returned by an earlier EDITABLE_TEXTBLOCK question or by a call to the import_text_block function.

The DFT must provide a fully qualified path to the Text Block.

If DFT is used in combination with FILE in a static Form, it is ignored.

DATE keyword

When the keyword DATE is specified, the user is asked to select a date. The values that are passed to DFT, VALUES and ANSWER are treated as NUMBER variables and are interpreted as YYYYMMDD. The keyword DATE also changes the way the question is displayed. In the KCM ComposerUI for HTML5 example implementation, the user can select a date from a calendar.

TIME keyword

When the keyword TIME is specified, the user is asked to select time. The values that are passed to DFT, VALUES and ANSWER are treated as NUMBER variables and are interpreted as HHMM in the 24-hour notation. In KCM ComposerUI for HTML5 the user can select a time from a (localized) time control.

VIEW keyword

VIEW name of view

Use the keyword VIEW to indicate that the user should select a Text Block from a Text Block List in KCM Designer. The name of the List is indicated by a TEXT value. The answer to the question is a TEXT value containing a reference to the Text Block that the user selected. Combining the VIEW keyword with the MULTISELECT keyword gives the user the possibility to select more than one Text Block.

FILTER keyword

FILTER name of filter

Use the keyword FILTER to apply the Filter function to the Text Block List. The Filter function is used to select matching Text Blocks from the list before the selection is presented to the user.

AUTOINSERT keyword

This keyword is deprecated, and you should not use it. It was used in combination with the VIEW keyword to automatically insert Text Blocks to be selected by the user in the result document.

To add the selected Text Blocks, use the TEXTBLOCK statement instead, as shown in the following example.

(* Declare the answers that will contain the selected Text Blocks *)
TEXT selected_tb
ARRAY TEXT selected_tbs

(* Form to select Text Blocks *)
FORM "Example"
QUESTION "Make a selection, select one"
VIEW "TBList" 
ANSWER selected_tb
QUESTION "Make a selection, more than one is possible"
MULTISELECT
VIEW "TBList" 
ANSWER selected_tbs

(* Add the selected Text Blocks to the result document. *)
TEXTBLOCK VAR selected_tb
TEXTBLOCK VAR selected_tbs

If the user selects multiple Text Blocks, they are separated by paragraph breaks. This behavior can be influenced by the AutoInsertSeparator and AutoInsertTerminator pragma functions.

EDITABLE_TEXTBLOCK keyword

Use the keyword EDITABLE_TEXTBLOCK to indicate that the user is asked to edit text content with some layout. The user may be asked to edit existing Text Blocks or to enter new text content with some layout.

TEXT newtext_reference
FORM "Enter text"
  QUESTION "Enter new text content"
    EDITABLE_TEXTBLOCK
    ANSWER newtext_reference
(* You can use an EDITABLE_TEXTBLOCK to insert the edited text into the result document *)
TEXTBLOCK
VAR newtext_reference

When the keyword EDITABLE_TEXTBLOCK is specified, the value passed to DFT should be a reference to a Text Block in KCM Designer. Also, you can specify the answer to an earlier EDITABLE_TEXTBLOCK question in the same Master Template.

TEXT edited_textblock1
TEXT edited_textblock2

FORM "Change text"
(* On this Form the question: "Edit the text content", allows you to edit the content of textblock1. The edited textblock is accessible through the variable editted_textblock1. The content of textblock1 stored in the CCM Repository is not changed. *)
  QUESTION "Edit the text content"
    EDITABLE_TEXTBLOCK
    DFT "textblock1"
  ANSWER edited_textblock1
FORM "Check earlier entered text"
(* A edited Text Block can be used as a default for another TEXTBLOCK question *)
  QUESTION "Check the text"
    EDITABLE_TEXTBLOCK
    DFT edited_textblock1
  ANSWER edited_textblock2
(* You can used an EDITABLE_TEXTBLOCK to insert the edited text into the result document. *)
TEXTBLOCK
VAR edited_textblock1
TEXTBLOCK
VAR edited_textblock2

The answer to an Editable_TEXTBLOCK question is a value of type TEXT. This value contains a reference to the Text Block content entered by the user. To insert the content provided by the user into the document, use the reference with the statement TEXTBLOCK (see TEXTBLOCK statement). You can also use it as the DFT value of a subsequent EDITABLE_TEXTBLOCK Form question. The reference cannot be stored.

VALUES keyword

VALUES (list with possible answers)

Use the keyword VALUES to create a list with possible answers. The user can select one of these values from a list to answer the question. The combination of the keywords VALUES and MULTISELECT gives the user the possibility to select more than one answer from the list.

A semicolon is used to separate items in the list. The items can be of type TEXT or type NUMBER, depending on the variable the answer is stored in.

TEXT answer_day
FORM "Select the answer"
QUESTION "Select a day"
VALUES ("Monday"; "Tuesday"; "Wednesday"; "Thursday"; "Friday"; "Saturday"; "Sunday")
ANSWER answer_day

Also, you can pass an ARRAY with possible answers.

MULTISELECT keyword

The MULTISELECT keyword is only used in combination with the keyword VALUES or VIEW. The keyword gives the user the possibility to select more than one answer or Text Block from the VALUES list or more than one Text Block from a VIEW. To store multiple answers, declare an ARRAY to save the answer to.

MULTISELECT cannot be used in combination with RADIOBUTTONS.

ORDER keyword

The keyword ORDER can only be used in combination with MULTISELECT.

When the keyword ORDER is defined, the user can select more than one answer or Text Block from the VALUES list or the VIEW and put this selection in the desired order.

RADIOBUTTONS keyword

This keyword is only used in combination with the keyword VALUES. It shows the possible answers in a radio button list.

HELPTEXT keyword

Use HELPTEXT to provide additional information for a question by means of a TEXT value. The help text may contain HTML instructions that are passed to KCM ComposerUI for HTML5. For example, this allows part of the help text to appear in bold or to insert a linefeed. The slash is used as the escape character in quoted text. Therefore HTML closing tags must be written as follows: <//b>. Using incorrect HTML tags may result in incorrect layout.

KCM ComposerUI for HTML5 shows a question mark when HELPTEXT is defined. When the mouse moves over this question mark, the help text shows up.

ERRORCONDITION keyword

ERRORCONDITION TRUE|FALSE

ERRORCONDITION gives the script developer the ability to check the answer that the user provides and to show a message. ERRORCONDITION is followed by a value type BOOL. This value is calculated when the user ends the form clicking OK or ENTER. If the value is TRUE, the message specified using the keyword MESSAGE is shown, and the user has to change the answer to the question before proceeding with the form.

MESSAGE keyword

When ERRORCONDITION is TRUE, the MESSAGE text is shown to the user. This text may contain HTML instructions that are passed to KCM ComposerUI for HTML5. This allows parts of the message text to appear in bold or to insert a linefeed. The slash is used as the escape character in quoted text. Therefore HTML closing tags must be written as follows: <//b>. Using incorrect HTML tags may result in damaged layout.

HIDECONDITION keyword

HIDECONDITION TRUE|FALSE

HIDECONDITION is followed by a value type BOOL. This value determines if a question is visible or not. The value of the BOOL is calculated when the form is loaded. If the value yields TRUE, the question is not shown. In this case, the DFT value is stored in a variable or an ARRAY element. If no DFT answer has been provided, the variable or the ARRAY element is assigned an empty value (in case of a TEXT), zero (in case of a NUMBER), or FALSE (in case of a BOOL).

By default, a question is shown.

READONLY keyword

READONLY TRUE|FALSE

READONLY is followed by a value type BOOL. This value determines if a question is read only or not. The value of the BOOL is calculated when the form is loaded.

By default, a question is editable.

FILE keyword

This keyword gives the user the ability to select a file with a file selection window. A variable or an ARRAY element where the answer to the question is stored must be of type TEXT.