我用ASP做了一个计算器,怎么不能运行啊

来源:百度知道 编辑:UC知道 时间:2024/06/16 19:02:59
在IE中运行,显示错误:类型不匹配
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>计算器</title>
</head>
<body>
<script language="vbscript">
dim bds
sub danji(t)
t=trim(t)
if((t="+") or (t="-") or (t="*") or (t="/")) then
document.f1.text1.value=""
if (right(bds,1)="" or right=(bds,1)="+" or right(bds,1)="-" or right(bds,1)="*" or right(bds,1)="/" ) then
msgbox("这样无法计算")
bds=""
exi

楼上的只能做一位数的运算,????

........................

用我的吧......

vbscript的程序

<html>

<head>
<title></title>
</head>

<body bgColor=#C0C0C0 text="#FFCCFF">
<script language="vbscript">
<!--
dim current:current=0
dim flagV
dim oldOp
dim display

sub key(ByVal num)
if flagV then
display.value=num
else
if display.value="0" then
display.value=cstr(num)
else
display.value=display.value&cstr(num)
end if
end if
end sub

sub decimal_onClick()
curReadout=display.value
if flagV then
curReadout="0."
FlagV=false
else
if instr(curReadout,".")=0 then
curReadout=curReadout&"."
end if
end if
display.value=curR