<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>Execute</title><revhistory><revision><revnumber>2</revnumber><date>2014-02-10 18:24:34</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>1</revnumber><date>2014-02-10 18:23:01</date><authorinitials>Inanna</authorinitials></revision></revhistory></articleinfo><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para>Usage: </para></entry><entry colsep="1" rowsep="1"><para>execute &quot;actions to be performed&quot; </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Example: </para></entry><entry colsep="1" rowsep="1"><para>execute &quot;goto city&quot; + city.timeSlot </para></entry></row></tbody></tgroup></informaltable><para>Allows you to force the bot to evaluate variables and perform functions or commands using the results. This is useful with older commands that do not support expressions by default.  </para><para>In the example above, if you had a script that you wanted to perform differently depending on which city it was being run in, you could set labels for each one... </para><screen><![CDATA[label city1
do stuff
end
]]><![CDATA[
label city2
do other stuff
end
]]><![CDATA[
label city3
do this stuff
end
]]><![CDATA[
label city4 
do this other stuff
end]]></screen><para>You could check which city you're in with the object city.timeSlot. However if you did <emphasis>goto city.timeSlot</emphasis> you would see the error <emphasis>&quot;Label 'city.timeSlot' not found&quot;</emphasis>. This is because the <ulink url="http://guide.neatportal.com/wiki/Execute/wiki/Goto#">Goto</ulink> command does not support the evaluation of city.timeSlot on it's own.  </para><para>With execute you could make it evaluate it... </para><screen><![CDATA[execute "goto city" + city.timeSlot]]></screen><para>The above line would evaluate first city.timeSlot into (for example &quot;2&quot;) and then execute the line <emphasis>goto city2</emphasis>, which would jump to the label city2 and perform whatever was there. </para><para>There are unlimited more uses for Execute, the above is merely one example.  </para><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="http://guide.neatportal.com/wiki/Execute/wiki/ScriptControlStructures#">ScriptControlStructures</ulink> </para></article>