<doc>
  <legacy_id>2087</legacy_id>
  <name>foundChunk</name>
  <type>function</type>
  <syntax>
    <example>the foundChunk</example>
    <example>foundChunk()</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Database Operations</category>
  </classification>
  <references>
    <command tag="find">find Command</command>
    <function tag="selectedChunk">selectedChunk 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 <glossary tag="chunk expression">chunk expression</glossary> describing the location of the text that was found by the most recent <command tag="find">find</command> <glossary tag="command">command</glossary>.</summary>
  <examples>
    <example>the foundChunk</example>
    <example>if the foundChunk is not word 1 of thingToFind then find thingToFind</example>
  </examples>
  <description>
    <p>Use the <b>foundChunk</b> function after a <command tag="find">find</command> <glossary tag="command">command</glossary> to determine where the text was found.</p><p/><p><b>Value:</b></p><p>The <b>foundChunk</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a <glossary tag="chunk expression">chunk expression</glossary> of the form<code> char <i>startChar</i> to <i>endChar</i> of field <i>fieldNumber</i></code>.</p><p/><p><b>Comments:</b></p><p>The <b>foundChunk</b> <control_st tag="function">function</control_st> is cleared when the text <keyword tag="selection">selection</keyword> moves into the <function tag="foundField">foundField</function> or when the <glossary tag="current card">current card</glossary> is closed. At the same time, the box the <command tag="find">find</command> command draws around the found text disappears. If there is no box, the <b>foundChunk</b> function <glossary tag="return">returns</glossary> empty.</p><p/><p>The return value reports the text that was found: the <i>startChar</i> is the first <keyword tag="character">character</keyword> of the found text, and the <i>endChar</i> is the last <keyword tag="character">character</keyword>. For example, if the most recent <command tag="find">find</command> <glossary tag="command">command</glossary> was<code> find "foo bar"</code>, either word might have been found.</p><p/><p>To get the actual text that was found, use the <b>foundText</b> <control_st tag="function">function</control_st>.</p>
  </description>
</doc>