Set Report1 = marketdata.GetReportData("IF08","ZJ")
currentPrice = Report1.NewPrice '现在最新价是2192
price = CATraderUI_priceTextBox.value
if (currentPrice >= price) then
msgbox ">="
else
msgbox "<"
end if
'无论在文本框中输入任何数,最后均出现 "<" 提示!不知问题出在哪儿了?
但如果我改写成
...
if (currentPrice >= 2000) then
msgbox ">="
else
msgbox "<"
end if
最后出现正确的提示 ">="
CATraderUI_priceTextBox文本框取值.Text取出来是String,.value取出来的Variant数据类型,它均不能与Report1.NewPrice直接比较大小吗?
切盼回复,谢谢!
price = CDbl(CATraderUI_priceTextBox.value)
强制转换一下文本框的文本为数字后再试试