title: Prolog if-statement
body: <p>I'm trying to implement a predicate that works as follows:</p>
  
  <pre><code>pred :-
     % do this always
  
     % if-statement
        %do this only, when if-statement is true
  
     % do this also always, independent if if-statement where true or false.
  </code></pre>
  
  <p>I need this functionality for a program, which has optionality a gui (XPCE) or not. You can call it with</p>
  
  <pre><code>start(true) % with gui
  </code></pre>
  
  <p>or</p>
  
  <pre><code>start(false) % without gui
  </code></pre>
  
  <p>Because I don't want to write two different predicates with the same logic, but one time with gui and another time without, I want to have one one predicate, that invokes the gui-code only if start(true) were invoked.</p>
  
  <p>Thanks for your help!</p>