<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi there<br>
      <br>
      OK, so I converted to elseif (source code at the bottom of my
      post). Now Scilab complains like this:<br>
      <br>
          elseif or[(model==3) (model==4)] then // FDD-LOG / CLOG<br>
                   !--error 35 <br>
      Syntax error in a 'if' instruction.<br>
      at line      11 of function getq called by :  <br>
      endfunction<br>
      <br>
      I'm replacing a CASE control with an ELSEIF and using the OR[] to
      collect my options. I tested the OR control on the command line,
      without problems, so I don't understand what Scilab is complaining
      about.<br>
      <br>
      Please let me know if you have any idea...<br>
      <br>
      Best regards,<br>
      Claus<br>
      <br>
      Here's a code snippet:<br>
      <span style="color:rgb(100,174,100);font-style:italic;"><br>
        // This function, getq, defines the q-values for all models.</span>
      <pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(160,32,240);">if</span> <span style="color:rgb(0,0,0);">model</span><span style="color:rgb(92,92,92);">==</span><span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(160,32,240);">then</span> <span style="color:rgb(100,174,100);font-style:italic;">// FDD</span>
       <span style="color:rgb(100,174,100);font-style:italic;">//</span>
       <span style="color:rgb(100,174,100);font-style:italic;">// q = 1 - this used to be 1 - beta*ln(w) also for FDD (!?!?)</span>
    <span style="color:rgb(0,0,0);">q</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">;</span>

<span style="color:rgb(160,32,240);">elseif</span> <span style="color:rgb(50,185,185);">or</span><span style="color:rgb(74,85,219);">[</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">model</span><span style="color:rgb(92,92,92);">==</span><span style="color:rgb(188,143,143);">3</span><span style="color:rgb(74,85,219);">)</span> <span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">model</span><span style="color:rgb(92,92,92);">==</span><span style="color:rgb(188,143,143);">4</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">]</span> <span style="color:rgb(160,32,240);">then</span> <span style="color:rgb(100,174,100);font-style:italic;">// FDD-LOG / CLOG</span>
         <span style="color:rgb(100,174,100);font-style:italic;">//</span>
         <span style="color:rgb(100,174,100);font-style:italic;">// q = 1 - beta * ln(w) - Scilab log(w) = natural log = ln(w))</span>
    <span style="color:rgb(0,0,0);">q</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(92,92,92);">-</span> <span style="color:rgb(0,0,0);">gbeta</span><span style="color:rgb(92,92,92);">*</span><span style="color:rgb(50,185,185);">log</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">w</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(100,174,100);font-style:italic;">// gbeta - it</span><span style="color:rgb(100,174,100);font-style:italic;">'</span><span style="color:rgb(100,174,100);font-style:italic;">s _not_ LOG model _lambda_</span>

<span style="color:rgb(160,32,240);">elseif</span> <span style="color:rgb(0,0,0);">model</span><span style="color:rgb(92,92,92);">==</span><span style="color:rgb(188,143,143);">2</span> <span style="color:rgb(160,32,240);">then</span> <span style="color:rgb(100,174,100);font-style:italic;">// LOG</span>
       <span style="color:rgb(100,174,100);font-style:italic;">//</span>
       <span style="color:rgb(100,174,100);font-style:italic;">// q = 1 - beta*ln(iw)</span>
       <span style="color:rgb(100,174,100);font-style:italic;">//</span>
    <span style="color:rgb(0,0,0);">q</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(92,92,92);">-</span> <span style="color:rgb(0,0,0);">gbeta</span><span style="color:rgb(92,92,92);">*</span><span style="color:rgb(50,185,185);">log</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(218,112,214);">%i</span> <span style="color:rgb(92,92,92);">.*</span> <span style="color:rgb(0,0,0);">w</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span></pre>
      <span style="color:rgb(160,32,240);">end</span><br>
      <br>
      On 22-01-2017 16:14, Samuel Gougeon wrote:<br>
    </div>
    <blockquote cite="mid:5884CC59.7070003@free.fr" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Hello Claus,<br>
        No it's not possible. It has been suggested here: <a
          moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://bugzilla.scilab.org/6503">http://bugzilla.scilab.org/6503</a><br>
        But chained <i>elseif </i>statements do the same in a fully
        versatile way.<br>
        HTH<br>
        Samuel<br>
        PS: BTW, i don't really understand the interest in the
        select/case structure wrt the elseif one.<br>
        select/case looks stiffer and less powerful.<br>
        <br>
        Le 22/01/2017 15:58, Claus Futtrup a écrit :<br>
      </div>
      <blockquote
        cite="mid:46e683a5-22fe-7b34-db0c-a012f7456e02@gmail.com"
        type="cite">Hi there <br>
        <br>
        I'd like to use the "case" control statement to select a few
        options. I'm wondering, is it possible for a case to have
        multiple options, I mean like this: <br>
        <br>
        select model <br>
        <br>
        case 1,3,4 then <br>
        <br>
            do something <br>
        <br>
        case 2 then <br>
        <br>
            do something <br>
        <br>
        case 5 then <br>
        <br>
            do something <br>
        <br>
        end <br>
        <br>
        Could I define [1 3 4] as a group of options and ask "CASE IN
        GROUP" ... or how would I go about and implement this? <br>
        <br>
        Best regards, <br>
        <br>
        Claus <br>
        <br>
        _______________________________________________ <br>
        users mailing list <br>
        <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
          href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
        <br>
        <a moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
        <br>
        <br>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>