Name: revPrintField

Type: command

Syntax: revPrintField <fieldDescriptor> 

Summary: Prints the contents of a <field>.

Introduced: 1.0

OS: mac,windows,linux

Platforms: desktop,web

Security: printing

Example:
revPrintField the name of field "Comments"

Example:
revPrintField the long ID of the mouseControl

Example:
revPrintField ("field" && 5) -- prints field 5

Parameters:
fieldDescriptor: Any expression that evaluates to a field reference.>*Important:* The revPrintField command does not accept direct field references. For example, the following statement causes an error message:   revPrintField field "My Field" -- CAN'T USE THIS FORM Instead, use a form that evaluates to a field reference, like this:
: revPrintField the name of field "My Field" -- use this form instead  revPrintField ("field" && quote & "My Field" & quote) -- or this

Description:
Use the <revPrintField> <command> to print the formatted contents of a <field> from within a <handler>.

>*Important:*  The <revPrintField> <command> does not accept direct <object reference|field references>. For example, the following <statement> causes an error message:

  revPrintField field "My Field" -- CAN'T USE THIS FORM

Instead, use a form that evaluates to a field reference, like this:

  revPrintField the name of field "My Field" -- use this form instead
  revPrintField ("field" && quote & "My Field" & quote) -- or this

The <revPrintField> <command> is equivalent to <select|selecting> the <field> and choosing File menu<img src="202656"/>Print Field<important/>.

If the field contains any expressions of the form &expression%&gt;, the expression is <evaluate|evaluated> and replaced with the value before the <field> is printed. For example, if the <field> contains the text
	Today's date is &lt;%the long date%&gt;
the printed text reads
	Today's date is Friday, February 15, 2002
(This assumes, of course, that the <revPrintField> <command> is <execute|executed> on that date). You can also use the special value &lt;%pageNumber%&gt; in the field: this value is replaced with the page number.

To show the standard print dialog box, use the revShowPrintDialog <command> before the <revPrintField> <command>.

>*Important:*  The <revPrintField> <command> is part of the <Printing library>. To ensure that the <command> works in a <standalone application>, you must include this <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section on the General screen of the <Standalone Application Settings> window, make sure that "Printing" is selected in the list of script libraries.

>*Note:* When included in a <standalone application>, the <Printing library> is implemented as a hidden <group> and made available when the <group> receives its first <openBackground> message. During the first part of the <application|application's> startup process, before this <message> is sent, the <revPrintField> <command> is not yet available. This may affect attempts to use this <command> in <startup>, <preOpenStack>, <openStack>, or <preOpenCard> <handler|handlers> in the <main stack>. Once the <application> has finished starting up, the <library> is available and the <revPrintField> <command> can be used in any <handler>.

References: field (keyword), startup (message), openBackground (message), preOpenStack (message), openStack (message), preOpenCard (message), revPrintReport (command), answer printer (command), application (glossary), standalone application (glossary), evaluate (glossary), execute (glossary), object reference (glossary), command (glossary), main stack (glossary), group (glossary), select (glossary), Standalone Application Settings (glossary), message (glossary), statement (glossary), handler (glossary), library (library), Revolution custom library (library), Printing library (library)

Tags: printing
