设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 25|回复: 2
打印 上一主题 下一主题

[求助]关于变量的一个问题

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-14 08:15:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
各位大哥大姐,请帮忙看看
我的源码是这样的
<!--#include file=head.asp -->
<!--#include file=conn.asp -->
<%
function talbe()
pyear=request.Form("pyear")
pmonth=request.Form("pmonth")
sql="select * from alldata where pyear="&pyear&" and pmonth="&pmonth&" order by month_day desc"
set rs=server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1

if rs.eof then
rs.Close
set rs=nothing
response.Write("对不起,您要查询的数据不存在,请重新<a href=show_view.asp>输入</a>")
else
Dim cou
cou=rs.RecordCount
co=rs.fields.Count
Dim info1(co)
For x=0 To co-1
info1(x)=rs("total_number")
rs.MoveNext
'info(x,2)=rs("total_money")
Next
'response.Write"<html xmlns:v='urn:schemas-microsoft-com:vml' xmlns:o='urn:schemas-microsoft-com:office:office'>"
response.Write"<v:group id='group1' style='width:600pt;height:400pt' coordsize='5000,3000'>"
response.Write"<v:line from='200,100' to='200,2800' style='z-index:8;position:absolute' strokeweight='1pt'>"
response.Write"<v:stroke startarrow='classic'/>"
response.Write"</v:line>"
response.Write"<v:polyline filled='false' points='"
For y=0 To cou
Dim c
c=y*400
response.Write info(y)&nbsp;&c&","
Next
"200 2800,1210 1400,2400 1220,3500 1700,4111 2600"
response.Write"style='z-index:8;position:absolute' />"
'<v:line from="1210,1400" to="1210,2800" style="z-index:8;position:absolute" strokeweight="1pt"/>
'<v:line from="2400,1220" to="2400,2800" style="z-index:8;position:absolute" strokeweight="1pt"/>
'<v:line from="3500,1700" to="3500,2800" style="z-index:8;position:absolute" strokeweight="1pt">
'<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td valign='top'>3000</td></tr></table></v:textbox>
'</v:line>
'<v:line from="4111,2600" to="4111,2800" style="z-index:8;position:absolute" strokeweight="1pt">
'<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td valign=""align='center'>3333</td></tr></table></v:textbox>
'</v:line>
response.Write"<v:line from='200,2800' to='5000,2800' style='z-index:8;position:absolute' strokeweight='1pt'/>"
response.Write"<v:stroke endarrow='classic'/>"
response.Write"</v:line>"
response.Write"<v:rect style='width:4900px;height:3000px' coordsize='21600,21600' fillcolor='white' strokecolor='black' />"
response.Write"</group> "
end if
rs.Close
set rs=nothing
end function
%>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!--[if !mso]>
<style>
v\:* { behavior: url(#default#VML) }
o\:* { behavior: url(#default#VML) }
.shape { behavior: url(#default#VML) }
</style>
<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<style>
TD { FONT-SIZE: 9pt}
</style></head>
<body topmargin=5 leftmargin=0 scroll=AUTO>
<%call table()%>
</body>
</html>
他的报错是这样的
错误类型:
Miceosoft VBScript编译器错误(0x800A0402)
缺少整形常数
/trade/show_success.asp.line 19,column 10
Dim info1(co)
------------ ^
我不太明白,谢谢!
2#
发表于 2010-1-14 08:15:26 | 只看该作者
Dim info1(co)
数组定义VB语法规定必须使用常量
Dim info1(5)这样定义才正确
如果楼主想要动态定义数组
请用ReDim关键字
用法
Dim info1()
ReDim info1(co)
这样就动态定义了这个数组。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-20 07:25 , Processed in 0.101029 second(s), 9 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表