以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  高级功能研发区  (http://www.weistock.com/bbs/list.asp?boardid=5)
----  区分reportnotify里面的reportdata  (http://www.weistock.com/bbs/dispbbs.asp?boardid=5&id=62086)

--  作者:李亚弟
--  发布时间:2014/2/27 9:24:46
--  区分reportnotify里面的reportdata

代码:

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这个属性并没有起到区分两个品种的作用。那该怎么样才能区分呢?


--  作者:王锋
--  发布时间:2014/2/27 16:19:41
--  

难道你不会

application.MsgOut reportdata.label

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


--  作者:李亚弟
--  发布时间:2014/2/28 9:21:19
--  

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