下面是引用philips980于2007-06-16 15:16发表的 vb加法显示问题:
a = Val(Text1)
b = Val(Text2)
c = Val(Text3)
Print (a + b + c)
.......
我给你一个vbscript 的范例
<!--请尊重智慧财产权,勿随便复制!-->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>新增网页1</title>
<script language="vbscript">
sub f()
a = cint(document.xxx.a.value)
b = cint(document.xxx.b.value)
c = cint(document.xxx.c.value)
sum = a + b + c
document.xxx.sum.value = sum
end sub
</script>
</head>
<body>
<form name="xxx">
A = <input type="text" name="a" size=3><br>
B = <input type="text" name="b" size=3><br>
C = <input type="text" name="c" size=3><br>
<input type="button" value=" = " onclick="f()"><br>
A + B + C = <input type="text" name="sum" size=5><br>
</form>
</body>
</html>
直接存成HTML档,执行浏览器就可以看出来了。