求助:ComboBox1和时间判断,h,s都是11, 为什么不等于啊?
//*******************************
Function 测试
Dim h,s
h = Hour(time)//时间
TracePrint "h等于" & h
索引 = Split(Form1.ComboBox1.List,"|") //获取ComboBox1
s = 索引(Form1.ComboBox1.ListIndex)
TracePrint "s等于" & s
If h = s Then
TracePrint "h等于s"
Else
TracePrint "h不等于s"
End If
End Function
Event Form1.Load
Form1.ComboBox1.List = "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24"
Form1.ComboBox1.ListIndex = 0
End Event
Call 测试

//*******************************
Function 测试
Dim h,s
h = Hour(time)//时间
TracePrint "h等于" & h
索引 = Split(Form1.ComboBox1.List,"|") //获取ComboBox1
s = 索引(Form1.ComboBox1.ListIndex)
TracePrint "s等于" & s
If h = s Then
TracePrint "h等于s"
Else
TracePrint "h不等于s"
End If
End Function
Event Form1.Load
Form1.ComboBox1.List = "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24"
Form1.ComboBox1.ListIndex = 0
End Event
Call 测试










