<doc>
  <legacy_id>2283</legacy_id>
  <name>compress</name>
  <type>function</type>
  <syntax>
    <example>the compress of <i>data</i></example>
    <example>compress(<i>data</i>)</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Text and Data Processing</category>
  </classification>
  <references>
    <function tag="decompress">decompress Function</function>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary><glossary tag="return">Returns</glossary> a gzip-compressed <keyword tag="string">string</keyword>.</summary>
  <examples>
    <example>compress(URL "file:image.pict")</example>
    <example>put compress(field "Outgoing") into URL "binfile:data.gz"</example>
  </examples>
  <description>
    <p>Use the <b>compress</b> <control_st tag="function">function</control_st> to <function tag="compress">compress</function> data to a smaller size for transmission.</p><p/><p><b>Parameters:</b></p><p>The <i>data</i> is a <keyword tag="string">string</keyword> of <glossary tag="binary data">binary data</glossary> of any length.</p><p/><p><b>Value:</b></p><p>The <b>compress</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a <keyword tag="string">string</keyword> of <glossary tag="binary data">binary data</glossary>.</p><p/><p><b>Comments:</b></p><p>The <b>compress</b> <control_st tag="function">function</control_st> is the <keyword tag="inverse">inverse</keyword> of the <function tag="decompress">decompress</function> <control_st tag="function">function</control_st>.</p><p/><p>The compressed result is typically about half to a third the size of the original data, although different results may be obtained depending on the amount of data and whether it has already been compressed.</p><p/><p><img src="202653"/> <b>Important!</b> The value <glossary tag="return">returned</glossary> by the <b>compress</b> <control_st tag="function">function</control_st> consists of <glossary tag="binary data">binary data</glossary> and may include control characters, so displaying it on screen or trying to edit it may produce unexpected results. If you use a <keyword tag="URL">URL</keyword> to place the <glossary tag="return">returned</glossary> data in a <keyword tag="file">file</keyword>, it's important to use the <keyword tag="binfile">binfile</keyword> <keyword tag="URL">URL</keyword> scheme; using the <keyword tag="file">file</keyword> <keyword tag="URL">URL</keyword> scheme will corrupt <glossary tag="binary data">binary data</glossary>.</p><p/><p>For technical information about the format used by the <b>compress</b> <control_st tag="function">function</control_st>, see RFC 1952 at &lt;<u>http://www.ietf.org/rfc/rfc1952.txt</u>&gt;. The <b>compress</b> <control_st tag="function">function</control_st> uses the zlib compression library.</p>
  </description>
</doc>