12.07.2015 Views

SPOT 4.1 Basic and Advanced Software Manual for SPOT Insight ...

SPOT 4.1 Basic and Advanced Software Manual for SPOT Insight ...

SPOT 4.1 Basic and Advanced Software Manual for SPOT Insight ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Ch. 13 - Macro ScriptingGeneric Example using ElseWhen the ELSE Comm<strong>and</strong> follows an IF Comm<strong>and</strong>, it is the default comm<strong>and</strong> should the IFComm<strong>and</strong> turn out to be false. In this “false” case, the comm<strong>and</strong> following the ELSE Comm<strong>and</strong>is executed. Interestingly, Example X, cited earlier (<strong>and</strong> below), includes an implicit ELSEComm<strong>and</strong>. When the IF Comm<strong>and</strong> was proven false, Comm<strong>and</strong> A1 was omitted, <strong>and</strong> Comm<strong>and</strong>B1 was carried out. Could the program just as well been written as the following Example X.1?Example XIF Comm<strong>and</strong>Comm<strong>and</strong> A1Comm<strong>and</strong> B1Comm<strong>and</strong> C1Comm<strong>and</strong>…≠Example X.1IF Comm<strong>and</strong>Comm<strong>and</strong> A1ElseComm<strong>and</strong> B1Comm<strong>and</strong> C1Comm<strong>and</strong>The answer is no! There is a difference. In Example X, Comm<strong>and</strong> B1 is carried out afterComm<strong>and</strong> A1 when the IF Comm<strong>and</strong> is true or when it is false. In the Example X.1, Comm<strong>and</strong>B1 will not get carried out if the IF Comm<strong>and</strong> proves to be true. Instead, Comm<strong>and</strong> A1 will becarried out, followed by Comm<strong>and</strong> C1, etc. In Example X.1, with the Else Comm<strong>and</strong>, thesubsequent comm<strong>and</strong> (Comm<strong>and</strong> B1) is only carried out if the IF Comm<strong>and</strong> is false. There<strong>for</strong>e, inExample X.1, a choice between Comm<strong>and</strong>s A1 <strong>and</strong> B1 is made. In Example X, the only choice iswhether to carry out Comm<strong>and</strong> A1 or not. Comm<strong>and</strong> B1 will always be implemented.The same use of the Else Comm<strong>and</strong> can be applied with blocks.Example ZIF Comm<strong>and</strong>Begin BlockComm<strong>and</strong> A1Comm<strong>and</strong> A2Comm<strong>and</strong> A3End BlockBegin BlockComm<strong>and</strong> B1Comm<strong>and</strong> B2Comm<strong>and</strong> B3End BlockComm<strong>and</strong> C1Comm<strong>and</strong>…≠Example Z.1IF Comm<strong>and</strong>Begin BlockComm<strong>and</strong> A1Comm<strong>and</strong> A2Comm<strong>and</strong> A3End BlockElseBegin BlockComm<strong>and</strong> B1Comm<strong>and</strong> B2Comm<strong>and</strong> B3End BlockComm<strong>and</strong> C1Comm<strong>and</strong>…User Guide to the <strong>SPOT</strong> <strong>Insight</strong> Camera 249

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!