<div dir="ltr">Thanks all for commenting, I changed the implementation and put the codes here: <a href="https://github.com/Shuai-Meng/wine/commit/bb212763ffd639a238b5a47f2c6a27047a79fdc5">https://github.com/Shuai-Meng/wine/commit/bb212763ffd639a238b5a47f2c6a27047a79fdc5</a><div>

It passed on both winxp and wine. But this patch still needs your comments.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-18 17:30 GMT+08:00 Jacek Caban <span dir="ltr"><<a href="mailto:jacek@codeweavers.com" target="_blank">jacek@codeweavers.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><div><div class="h5">
    <div>On 07/18/14 04:11, Shuai Meng wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">2014-07-17 11:11 GMT+08:00 Dmitry
            Timoshkov <span dir="ltr"><<a href="mailto:dmitry@baikal.ru" target="_blank">dmitry@baikal.ru</a>></span>:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Shuai
              Meng <<a href="mailto:mengshuaicalendr@gmail.com" target="_blank">mengshuaicalendr@gmail.com</a>>
              wrote:<br>
              <br>
              > +        switch(V_VT(arg)) {<br>
              > +        case VT_UI1:<br>
              > +        case VT_I2:<br>
              > +        case VT_I4:<br>
              > +        case VT_I8:<br>
              > +        case VT_R4:<br>
              > +        case VT_R8:<br>
              > +        case VT_BOOL:<br>
              > +        case VT_EMPTY:<br>
              > +        case VT_CY:<br>
              > +            V_BOOL(res) = VARIANT_TRUE;<br>
              > +            break;<br>
              <br>
              This list is far from being complete. It seems that it
              should also<br>
              contain at least VT_UI2, VT_UI4, VT_UI8, VT_I1, VT_INT,
              VT_UINT.<br>
              VT_VECTOR, VT_ARRAY and VT_BYREF modifers probably also
              should be<br>
              taken into account.<br>
              <span><font color="#888888"><br>
                  --<br>
                  Dmitry.<br>
                </font></span></blockquote>
          </div>
          Hi, I think over it again. Let's face the fact: what are all
          the possible results of  switch(V_VT(arg)) ? Will VT_UI2,
          VT_UI4, VT_UI8, VT_I1, VT_INT, VT_UINT and so on exist? My
          answer is no. arg comes from users' input, which means it only
          belongs to the  subtypes of variant, see here:</div>
        <div class="gmail_extra"><a href="http://msdn.microsoft.com/en-us/library/9e7a57cf%28v=vs.84%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/9e7a57cf(v=vs.84).aspx</a><br>
        </div>
      </div>
    </blockquote>
    <br></div></div>
    No, your answer is wrong. VBScript code may be called from
    non-VBScript (and the other way around) and then any type of VARIANT
    may be passed around. Also, please add a test with an object having
    default value, which is of numeric type. I have a feeling that the
    right thing to do here is to call to_double and see if it fails or
    not, but this needs tests to confirm.<span class="HOEnZb"><font color="#888888"><br>
    <br>
    Jacek<br>
  </font></span></div>

</blockquote></div><br></div>