我做了一个新的函数调用length,它测试字符的数量,如果计数大于5,则显示"错误结果".但是,函数的结果是#NUM!如果测试是5个字符或更少,则显示结果.
怎么了?
Function length (number as integer)
If ( Len (CStr (number)) > 5 ) then
length = "error"
End if
If ( Len (Cstr (number)) <6) then
length = "the count is true"
End if
End Function
Run Code Online (Sandbox Code Playgroud)