<SCRIPT language=VBscript>
dim result
dim Ret
result = SendCmdToServer ( 1 ,"","",0, ByRef Ret )
</SCRIPT>

解决方案 »

  1.   

    //convert numeric into string likes fmt
    function format(val,fmt)
    {
    val=parseFloat(""+val);
    if (val>=0)
    return _format(val,fmt);
    else
    return "-"+_format(-val,fmt);
    }
    function _format(val,fmt)
    {
    //val=parseFloat(""+val);
    if(isEmptyString(fmt)) fmt="#,##0.00";
    var pat,reg,i,hp,bp,tp,bLen;
    var vhp,vtp;
    //fmt="#,##0";
    ///////分解格式化字符串
    reg=/^([#0]+)(,[#0]+)?(\x2e[0]*)?$/;
    pat=fmt.match(reg);
    hp=bp=tp="";
    for(i=pat.length-1 ;i>0;i--)
    switch(pat[i].substring(0,1))
    {
    case ",":
    bp=pat[i].substr(1);
    break;
    case ".":
    tp=pat[i].substr(1);
    break;
    default:
    hp=pat[i];
    break;
    }
    if (bp=="")
    {
    bLen=0;//不分段
    }
    else
    {
    hp=bp;
    bLen=bp.length;///分段长度
    }
    //求整数部分最小长度
    var zeroLen=hp.match(/^#*(0*)$/)[1].length;

    //////////////分解数据字符串
    val=""+val;
    reg=/^(\d*)(\x2e\d*)?$/;
    pat=val.match(reg);
    vhp=vtp="";
    for(i=pat.length-1 ;i>0;i--)
    switch(pat[i].substring(0,1))
    {
    case ".":
    vtp=pat[i].substr(1);
    break;
    default:
    vhp=pat[i];
    break;
    }
    //////////小数部分
    if(vtp.length>tp.length && vtp.substr(tp.length,1)>"4") //进行进位计算
    {
    var inc="1";
    for(i=1;i<tp.length;i++) inc="0"+inc;inc="0."+inc;
    vtp=vtp.substr(0,tp.length);
    val=parseFloat(vhp+"."+vtp)+parseFloat(inc);
    val=""+val;
    pat=val.match(reg);
    vhp=vtp="";
    for(i=pat.length-1 ;i>0;i--)
    switch(pat[i].substring(0,1))
    {
    case ".":
    vtp=pat[i].substr(1);
    break;
    default:
    vhp=pat[i];
    break;
    }
    }
    else
    vtp=vtp.substr(0,tp.length);
    while(vtp.length<tp.length) vtp+="0";
    //////////整数部分
    while(vhp.length<zeroLen) vhp="0"+vhp; //补足足够的长度
    //alert(bLen);
    if(bLen>0)  //加逗号分割
    {
    var cnt=0;
    cnt= bLen-(vhp.length - Math.floor(vhp.length/bLen)*bLen);
    if(cnt==bLen) cnt=0;
    for(i=0;i<cnt;i++) vhp="0"+vhp;
    reg=new RegExp("(\\d{"+bLen+"})","gi");
    //reg=/(\d{3})/g;
    vhp=vhp.replace(reg,",$1");
    vhp=vhp.substr(cnt+1);
    }
    return vhp+"."+vtp;
    }
      

  2.   

    在弱类型语言中调用的Active X 不能使用除variant类型外的其余类型.
      

  3.   

    具体的使用如下:
    <HTML>
    <HEAD>
    <title>WebForm1</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <script language="javascript">

    function testpdm()
    {
    var result="";
    PdmAgent.SendCmdToServer(1, "ID_APP_PDM_SEARCH", "", 0,result);
    }

    </script>
    </HEAD>
    <body MS_POSITIONING="GridLayout">

    <OBJECT id="PdmAgent" classid="clsid:AD180329-2C39-4109-89AA-2354D28ED6C2" VIEWASTEXT>
    <PARAM NAME="_Version" VALUE="65536">
    <PARAM NAME="_ExtentX" VALUE="2646">
    <PARAM NAME="_ExtentY" VALUE="1323">
    <PARAM NAME="_StockProps" VALUE="0">
    </OBJECT>
    <form id="Form1" method="post" runat="server">
    <INPUT style="Z-INDEX: 102; LEFT: 92px; POSITION: absolute; TOP: 23px" type="button" onclick="testpdm()" value="pdm">
    </FONT>
    </form>
    </body>
    </HTML>使用
    <script language="vbscript">
    Function testpdm()
    Dim result
    dim Ret
    result = PdmAgent.SendCmdToServer(1, "ID_APP_PDM_SEARCH", "", 0, ByRef Ret)
    End Function 

    </script>
    还是有问题
      

  4.   

    yonghengdizhen(傅立叶变换)如不可使用,那不是要改写ocx?