以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  if 语句  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=178793)

--  作者:fvcfox
--  发布时间:2022/7/21 8:43:00
--  if 语句
不知为什么不会elseif 语句
   If i < 1024 Then
        si = i & " B"
    ElseIf 1048576 > i >= 1024 Then
        MessageBox.Show(i)
        si = CStr(round2(i / 1024, 2)) & " KB"
    ElseIf 1073741824 > i >= 1048576 Then
        MessageBox.Show("M")
        si = round2(i / 1024 / 1024, 2) & " MB"
    End If
    MessageBox.Show(i)
    r("大小") = si

--  作者:有点蓝
--  发布时间:2022/7/21 9:20:00
--  
ElseIf 1048576 > i >= 1024 Then
改为
ElseIf 1048576 > i andalso i >= 1024 Then