Rss & SiteMap

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

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

标题:VBA求助

1楼
Leon 发表于:2012/6/11 12:47:24

不知道什么原因,总提示语法错误,将前两行的定义 数据类型去掉,仍然报语法错误,希望高手解答啊~

public InpMinihub as Integer
 public hubnum as Integer

 public hubid()
 public hubopen()
 public hubclose()
 public hubbas()
 public hublast()

 private history
 private grd 

Sub Init(gridobj as grid)
 grd=gridobj
 history=grd.getHistoryData()
 InpMiniHub=3
End Sub

Sub getHub()
 hubnum=0
 barpos=0
 do
  barpos=dupHub(barpos)
 loop while barpos<history.count-1

End Sub


Function dupHub(pos as integer)
 dim curopen,curclose,curbas,curlast
 dim wide as integer
 
 curopen=history.High(pos)
 curclose=history.Low(pos)
 curbas=pos
 wide=1
 
 for idx=pos+1 to history.datacount-1
  if (history.high(idx)<curclose or history.low(idx)>curopen) then
   if (wide<InpMiniHub) then
    dupHub=idx
    exit function
   else
    hubopen(hubnum)=curopen
    hubclose(hubnum)=curclose
    hubbas(hubnum)=curbas
    hublast(hubnum)=idx-1
    hubwide(hubnum)=getHubLevel(hublast-hubbas+1)
    hubid(hubnum)="0_"+hubbas(hubnum)+"_"+hublast(hubnum) 
    dupHub=idx
    hubnum++
    exit function
   end if
  else
   wide++
   curopen=(curopen*wide+history.high(idx))/(wide+1)
   curclose=(curclose*wide+history.low(idx))/(wide+1)
  end if
 next
 
End Function

2楼
王锋 发表于:2012/6/11 14:58:43

你这里根本就不是VBS的语法

3楼
guotx2010 发表于:2012/6/11 16:05:13

vbs没有数据类型定义的,那些as Integer之类的都需要修改,函数的参数也一样,不要定义数据类型。

4楼
guotx2010 发表于:2012/6/11 16:06:20

http://www.weistock.com/bbs/dispbbs.asp?boardid=5&Id=10387

看看这个帖子,好好学习一下vbs语法。

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


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