<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
Copyright (c) 2006 UGS Corp.

All Rights Reserved.

This software and related documentation are proprietary to UGS Corp.
-->
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Inserting User-Defined Code</title>
      <script language="javaScript">
        abridged="false";
        displayConditions=new Array();
      </script>
      <link type="text/css" href="../css/main_styles.css" rel="stylesheet">
   </head>
   <body class="bodydocs" onload="top.pageLoader()" bgcolor="#FFFFFF">
      <div class="title_topic2" id="xps10_pagetitle">Inserting User-Defined Code</div>
      <hr noshade="true">
      <table cellspacing="4" align="center">
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('shared_func/tls_jrn_ov.html');return(false);">Overview</a></p>
            </td>
            <td bgcolor="#c0c0c0" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('shared_func/tls_jrn_ht.html');return(false);">How To</a></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('shared_func/tls_jrn_op.html');return(false);">Options</a></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('shared_func/tls_jrn_rt.html');return(false);">Related Topics</a></p>
            </td>
         </tr>
      </table><br><p class="para_topic">You can insert user-defined code into a journal. This allows you to add user interface code, loops, or other customizations. To insert code:</p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">While recording a journal, select Tools&rarr;Journal&rarr;Insert&rarr;User Defined Code. This displays the Insert User Defined Journal Code dialog box that allows you to enter multiple lines of code in the upper window and view the current journal contents in the lower window.</p>
         </li>
         <li>
            <p class="para_item">Enter code into the dialog box's upper window.</p>
         </li>
         <li>
            <p class="para_item">To insert the code and close the dialog box, click <b class="uiTerm">OK</b>.
            </p>
         </li>
      </ol>
      <ul>
         <li>
            <p class="para_item">To insert the code and view the appended code in the lower window of the dialog box, click <b class="uiTerm">Apply</b>.
            </p>
         </li>
         <li>
            <p class="para_item">To close the dialog box and not insert the code, click <b class="uiTerm">Cancel</b>.
            </p>
         </li>
      </ul>
      <table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/note.gif" alt="Note" title="Note"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_note">
                  <p class="para_note_body">This command does not verify that code syntax is correct. Inserting code that is not syntactically correct will result in errors during journal compilation or replay.</p>
               </div>
            </td>
         </tr>
      </table>
      <div class="title_division">Code Syntax</div>
      <p class="para_division">The NX Journal Utility does not translate the code you enter into the syntax of the selected recording language. For example:</p>
      <p class="para_division">Text entered into the dialog box in VB.NET syntax:</p><pre class="indent">    theSession.ListingWindow.Open
theSession.ListingWindow.WriteLine(&quot;Hello World&quot;)</pre><p class="para_division">Text in the journal for VB.NET, C++ and Java:</p><pre class="indent">    theSession.ListingWindow.Open
theSession.ListingWindow.WriteLine(&quot;Hello World&quot;)</pre></body>
</html>