打印本文打印本文 关闭窗口关闭窗口

区分reportnotify里面的reportdata

作者:金字塔 来源:cxh99.com 发布时间:2014年03月20日
  • 咨询内容:

    代码:

    Sub UserForm1_CommandButton1_Click()
        call marketdata.RegReportNotify("cu00","sy")
        call marketdata.RegReportNotify("ag00","sy")
    End Sub
    sub marketdata_reportnotify(reportdata)
        dim newprice_cu,newprice_ag
        if reportdata.label="cu00" then
           newprice_cu=reportdata.newprice
           application.MsgOut "newprice_cu:"& newprice_cu
        else
           newprice_ag=reportdata.newprice
           application.MsgOut "newprice_ag:"& newprice_ag
        end if
    end sub


    Sub UserForm1_CommandButton2_Click()
        application.MsgOut time
        call marketdata.UnRegReportNotify("cu00","sy")
        call marketdata.UnRegReportNotify("ag00","sy")
    End Sub

     

    执行效果:

    newprice_ag:4316
    newprice_ag:4316
    newprice_ag:49560
    newprice_ag:4316
    newprice_ag:4315
    newprice_ag:49560
    newprice_ag:4315

     

    也就是说,label这个属性并没有起到区分两个品种的作用。那该怎么样才能区分呢?

     

  • 金字塔客服:

    难道你不会

    application.MsgOut reportdata.label

    这样输出一下标签内容,看看金字塔是怎么样的格式?

     

  • 用户回复:

    是"AG00""CU00",不是"ag00""cu00"

打印本文打印本文 关闭窗口关闭窗口