if vars("h")="×" then
e.form.controls("zqda").text = Eval("[!x] * [!y]")
dim da as integer = Eval("[!x] * [!y]")
elseif vars("h")="÷" then
e.form.controls("zqda").text = Eval("[!x] / [!y]")
dim da as integer = Eval("[!x] / [!y]")
elseif vars("h")="-" then
e.form.controls("zqda").text = Eval("[!x] - [!y]")
dim da as integer = Eval("[!x] - [!y]")
else
e.form.controls("zqda").text = Eval("[!x] + [!y]")
dim da as integer = Eval("[!x] + [!y]")
end if
上面的这段代码设置后就出现在上面的提示。但是单独用下面的代码则正确,不知问题在哪?
e.form.controls("zqda").text = Eval("[!x] + [!y]")
dim da as integer = Eval("[!x] + [!y]")
Dim da as integer
if "+-×÷".IndexOf(vars("h")) >-1 then
Dim n As Double = Eval("[!x]" & vars("h").Replace("×","*").Replace("÷","/") & "[!y]")
e.Form.controls("zqda").text = n
da= n
end if
[此贴子已经被作者于2008-10-28 19:02:12编辑过]
楼上的能否在代码后加以备注说明?我不太懂,只有按最原始的代码一步步写。呵呵,不会精简。