arc:else

Version 22.0.8473


arc:else

Version 22.0.8473


The arc:else keyword is used to execute an alternate block of code when a test like arc:exists or arc:match fails. It can also be used to execute an alternate block of code within an arc:call when the call fails to produce any output items.

Unlike other languages, ArcScript requires the arc:else statement to be within the scope of the test it belongs to.

Parameters

None

Control Attributes

None

Examples

Return a placeholder title if the file does not have a name:

<arc:call op="fileListDir" out="out">
  <arc:null attr="filename">
    <arc:set attr="title" value="Unnamed File"/>
    <arc:else>
      <arc:set attr="title" value="[filename]"/>
    </arc:else>
  </arc:null>
  <arc:push title="[title]">
  [out.*]
  </arc:push>
</arc:call> 

See Also