<doc>
  <legacy_id>1311</legacy_id>
  <name>revPrintField</name>
  <type>command</type>
  <syntax>
    <example>revPrintField <i>fieldDescriptor</i></example>
  </syntax>
  <library>Printing library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Printing</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <command tag="answer printer">answer printer Command</command>
    <command tag="revPrintReport">revPrintReport Command</command>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <web/>
  </classes>
  <security>
    <printing/>
  </security>
  <summary>Prints the contents of a <keyword tag="field">field</keyword>.</summary>
  <examples>
    <example>revPrintField the name of field "Comments"</example>
    <example>revPrintField the long ID of the mouseControl</example>
    <example>revPrintField ("field" &amp;&amp; 5) <code><i>-- prints field 5</i></code></example>
  </examples>
  <description>
    <p>Use the <b>revPrintField</b> <glossary tag="command">command</glossary> to print the formatted contents of a <keyword tag="field">field</keyword> from within a <glossary tag="handler">handler</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>fieldDescriptor</i> is any <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <href tag="reference/object_reference.rev">field reference</href>.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> The <b>revPrintField</b> <glossary tag="command">command</glossary> does not accept direct <href tag="reference/object_reference.rev">field references</href>. For example, the following <glossary tag="statement">statement</glossary> causes an error message:</p><p/><p><code>  revPrintField field "My Field" </code>-- <code/><b>CAN'T USE THIS FORM</b><code/></p><p/><p>Instead, use a form that evaluates to a field reference, like this:</p><p/><p><code>  revPrintField the name of field "My Field" </code><code><i>-- use this form instead</i></code></p><p><code>  revPrintField ("field" &amp;&amp; quote &amp; "My Field" &amp; quote) </code><code><i>-- or this</i></code></p><p/><p><b>Comments:</b></p><p>The <b>revPrintField</b> <glossary tag="command">command</glossary> is equivalent to <glossary tag="select">selecting</glossary> the <keyword tag="field">field</keyword> and choosing File menu<img src="202656"/>Print Field<important/>.</p><p/><p>If the field contains any expressions of the form<code> &amp;<i>expression</i>%&gt;</code>, the <i>expression</i> is <glossary tag="evaluate">evaluated</glossary> and replaced with the value before the <keyword tag="field">field</keyword> is printed. For example, if the <keyword tag="field">field</keyword> contains the text</p><p><b>	Today's date is &lt;%the long date%&gt;</b></p><p>the printed text reads</p><p><b>	Today's date is Friday, February 15, 2002</b></p><p>(This assumes, of course, that the <b>revPrintField</b> <glossary tag="command">command</glossary> is <glossary tag="execute">executed</glossary> on that date). You can also use the special value<code> &lt;%pageNumber%&gt;</code> in the field: this value is replaced with the page number.</p><p/><p>To show the standard print dialog box, use the <b>revShowPrintDialog</b> <glossary tag="command">command</glossary> before the <b>revPrintField</b> <glossary tag="command">command</glossary>.</p><p/><p><code/><b><img src="202653"/> Important!</b><code/> The <b>revPrintField</b> <glossary tag="command">command</glossary> is part of the <glossary tag="Printing library">Printing library</glossary>. To ensure that the <glossary tag="command">command</glossary> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section on the General screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure that "Printing" is selected in the list of script libraries.</p><p/><p><code/><b>Note:</b><code/> When included in a <glossary tag="standalone application">standalone application</glossary>, the <glossary tag="Printing library">Printing library</glossary> is implemented as a hidden <command tag="group">group</command> and made available when the <command tag="group">group</command> receives its first <message tag="openBackground">openBackground</message> message. During the first part of the <glossary tag="application">application's</glossary> startup process, before this <keyword tag="message box">message</keyword> is sent, the <b>revPrintField</b> <glossary tag="command">command</glossary> is not yet available. This may affect attempts to use this <glossary tag="command">command</glossary> in <message tag="startup">startup</message>, <message tag="preOpenStack">preOpenStack</message>, <message tag="openStack">openStack</message>, or <message tag="preOpenCard">preOpenCard</message> <glossary tag="handler">handlers</glossary> in the <glossary tag="main stack">main stack</glossary>. Once the <glossary tag="application">application</glossary> has finished starting up, the <command tag="start using">library</command> is available and the <b>revPrintField</b> <glossary tag="command">command</glossary> can be used in any <glossary tag="handler">handler</glossary>.</p>
  </description>
</doc>