hdstu 发表于 2009-8-15 10:41:44

求助一个小小的计算

本帖最后由 hdstu 于 2009-8-17 16:49 编辑

Dim $fpqh,$fpzh,$kjfs
Dim $bl=1
Dim $lgfs=$fpzh-$fpqh+$bl
If @error=1 Or $lgfs="" and $fpqh="" and $fpzh="" and $kjfs="" Then
EndIf
$fpzh=inputBox("发票统计","请录入发票止号")
$fpqh=inputBox("发票统计","请录入发票起号")
Select
        Case $fpzh="" and $fpqh=""
                MsgBox("0","发票统计","请录入数据")
        Case Else
                MsgBox("0","发票统计","领购份数为:"&$lgfs&"")
EndSelect


录入起号,止号,计算结果总是“1” 高手们指点下 谢谢

afan 发表于 2009-8-15 11:16:22

Dim $fpqh, $fpzh, $kjfs, $bl = 1, $lgfs
If @error = 1 Or $lgfs = "" And $fpqh = "" And $fpzh = "" And $kjfs = "" Then
EndIf
$fpzh = InputBox("发票统计", "请录入发票止号")
$fpqh = InputBox("发票统计", "请录入发票起号")
Select
        Case $fpzh = "" And $fpqh = ""
                MsgBox("0", "发票统计", "请录入数据")
        Case Else
                $lgfs = $fpzh - $fpqh + $bl
                MsgBox("0", "发票统计", "领购份数为:" & $lgfs & "")
EndSelect

hdstu 发表于 2009-8-15 14:57:38

Dim $fpqh, $fpzh, $kjfs, $bl = 1, $lgfs
If @error = 1 Or $lgfs = "" And $fpqh = "" And $fpzh = "" And $kjfs = "" Then
EndIf
$fpzh = InputBox("发票统计", "请录入发票止号")
$fpqh = InputBox("发票统计 ...
afan 发表于 2009-8-15 11:16 http://www.autoitx.com/images/common/back.gif


去掉了Dim $lgfs=$fpzh-$fpqh+$bl

kn007 发表于 2009-8-15 17:56:19

楼上的什么意思???

顽固不化 发表于 2009-8-15 21:01:29

lz的代码,存在逻辑上的不足。

hdstu 发表于 2009-8-15 21:21:50

呵,我在看教程 一边看,一边学习
页: [1]
查看完整版本: 求助一个小小的计算