不知道什么原因,总提示语法错误,将前两行的定义 数据类型去掉,仍然报语法错误,希望高手解答啊~
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
你这里根本就不是VBS的语法
vbs没有数据类型定义的,那些as Integer之类的都需要修改,函数的参数也一样,不要定义数据类型。
http://www.weistock.com/bbs/dispbbs.asp?boardid=5&Id=10387
看看这个帖子,好好学习一下vbs语法。