Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:区分reportnotify里面的reportdata

1楼
李亚弟 发表于:2014/2/27 9:24:46

代码:

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

2楼
王锋 发表于:2014/2/27 16:19:41

难道你不会

application.MsgOut reportdata.label

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

3楼
李亚弟 发表于:2014/2/28 9:21:19

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

共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.06250 s, 2 queries.