<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 07/18/14 04:11, Shuai Meng wrote:<br>
    </div>
    <blockquote
cite="mid:CAOhhAYMLXgNe6Sscx9usWq7rU2Zy=Ngy8sF2QKnne_mh=8DL0w@mail.gmail.com"
      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 moz-do-not-send="true"
                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 moz-do-not-send="true"
                href="mailto:mengshuaicalendr@gmail.com">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 class=""><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 moz-do-not-send="true"
href="http://msdn.microsoft.com/en-us/library/9e7a57cf%28v=vs.84%29.aspx">http://msdn.microsoft.com/en-us/library/9e7a57cf(v=vs.84).aspx</a><br>
        </div>
      </div>
    </blockquote>
    <br>
    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.<br>
    <br>
    Jacek<br>
  </body>
</html>