title: robot test framework: how does Set Variable if work?
body: <p>I have following Keywords:</p>
  
  <pre><code>  App For Port    [Arguments]    ${app}
    # Try to launch one app on either port, continue if it fails on port 1 and launch it on port 2, record if it fails on both.
        ${returned_port}    Set Variable    ${1}
      : FOR    ${port_num}    IN    1    2
      \    ${returned_port}    Set Variable If    ${port_num} == 2    ${2}
      \    Check App Launch    ${app}    ${port_num}
      Return From Keyword    ${returned_port}
  </code></pre>
  
  <p><code>${returned_port}    Set Variable    ${1}</code> works fine, <code>${returned_port}</code> is 1 after this line. </p>
  
  <p>However, 
  <code>${returned_port}    Set Variable If    ${port_num} == 2    ${2}</code> gives <code>${returned_port}</code> None value. </p>
  
  <p>I'm really confused. How can I make it to set <code>${returned_port}</code> to 2??   Thanks in advance!!</p>