代碼:
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
執(zhí)行效果:
newprice_ag:4316
newprice_ag:4316
newprice_ag:49560
newprice_ag:4316
newprice_ag:4315
newprice_ag:49560
newprice_ag:4315
也就是說,label這個屬性并沒有起到區(qū)分兩個品種的作用。那該怎么樣才能區(qū)分呢?
難道你不會
application.MsgOut reportdata.label
這樣輸出一下標簽內容,看看金字塔是怎么樣的格式?
是"AG00""CU00",不是"ag00""cu00"