Example

The example in Figure 1 shows how to send trace messages to the HCL ZIETrans Toolkit console. This example uses the following action elements: Trace and Variable update.

You can copy the text of this macro script from this document into the system clipboard, and then from the system clipboard into the source view (see Samples). After you save this script in the macro editor, you can edit it.

Notice the following facts about this example:
  • The example consists of one entire macro script named TRACE.
  • The <create> element creates a string variable named $strData$ and initializes it to an original value of 'Original value'.
  • The first action is a Trace action with the Trace Text set to 'The value is' + $strData$.
  • The second action is a Variable update action that sets the variable $strData$ to a new value of 'Updated value'.
  • The third action is another Trace action identical to the first Trace action.
Figure 1. Sample code TRACE
<HAScript name="TRACE" description=" " timeout="60000" pausetime="300"
            promptall="true" author="" creationdate="" supressclearevents="false"
             usevars="true" ignorepauseforenhancedtn="false"
             delayifnotenhancedtn="0">
   <vars>
      <create name="$strData$" type="string" value="'Original value'" />
   </vars>
   <screen name="Screen1" entryscreen="true" exitscreen="false" transient="false">
      <description>
          <oia status="NOTINHIBITED" optional="false" invertmatch="false" />
      </description>
      <actions>
         <trace type="SYSOUT" value="'The value is '+$strData$"  />
         <varupdate name="$strData$" value="'Updated value'" />
         <trace type="SYSOUT" value="'The value is '+$strData$"  />
      </actions>
      <nextscreens timeout="0" >
      </nextscreens>
  </screen>
This script in Figure 1 causes the macro runtime to send the following data:
The value is +{$strData$ = Original value}
The value is +{$strData$ = Updated value}
In the trace output above, notice that instead of just displaying the value of $strData$, the Debug action displays both the variable's name and its value inside braces.