以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  高级功能研发区  (http://weistock.com/bbs/list.asp?boardid=5)
----  这段代码有错吗  (http://weistock.com/bbs/dispbbs.asp?boardid=5&id=57313)

--  作者:jinze
--  发布时间:2013/10/9 9:57:50
--  这段代码有错吗

if not(wucode) then
 set Report1 = MarketData.GetReportData(Code,Market1)
 if i=0 then
 MaxVolume = Report1.Volume
 end if
 
    If Report1.Volume = MaxVolume Then
     MaxCode = Report1.Label
     \'MaxVolume = Report1.Volume
    End if
end if

 

每次升级后都提示“If Report1.Volume = MaxVolume Then”这句424错误。


--  作者:jinze
--  发布时间:2013/10/9 10:30:52
--  
管理员了
--  作者:王锋
--  发布时间:2013/10/9 12:24:29
--  

MarketData.GetReportData(Code,Market1)

你仔细检查一下 Code,Market1 这两个变量的品种是不是系统里面没有,没有的话Report1 对象就是控制,自然就会出现问题。

 

为了防止出现异常,建议你的代码中涉及到对象引用时,要加以对象是否为空的判断

 

set Report1 = MarketData.GetReportData(Code,Market1)

if not(Report1 is nothingthen
  \'相应的处理
end if


--  作者:jinze
--  发布时间:2013/10/9 14:30:42
--  
if not(wucode) then
这句就是对对象是否为空的判断。