[已解决]数字运算问题
本帖最后由 king8462 于 2011-8-16 13:57 编辑从listview中获取字符串,然后使用StringSplit后无法正常运算,求解!Func _del()
$d = MsgBox(1 + 64, "提示", "是否删除选中项目?")
If $d = 1 Then
$key = _GUICtrlListView_GetItemTextString($ListView2)
$key2 = StringSplit($key, '|', 1)
GUICtrlSetData($Inputdh,$key2)
MsgBox(0,"0",$key2)
$heji= GUICtrlRead($input11)
$key3=GUICtrlRead($inputdh)
$66=_GetNumber($key3)
$heji2=$heji-$66
GUICtrlSetData($Input11,$heji2)
_GUICtrlListView_DeleteItemsSelected($ListView2)
ElseIf $d = 2 Then
MsgBox(64, "", "你放弃删除选中项!")
EndIf
EndFunc ;==>_del 代码很隐秘吗?能否看看完整的呢? 回复 2# 水木子
万一你偷学了怎么办呢,哈哈…… 刚好找到个例子
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("数字运算问题", 382, 139, 214, 150)
GUISetOnEvent($GUI_EVENT_CLOSE, "Event")
$ListView1 = GUICtrlCreateListView("1 |2", 40, 24, 300, 89)
;GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100)
$ListView1_0 = GUICtrlCreateListViewItem("123 |456", $ListView1)
GUICtrlSetOnEvent($ListView1_0, "Event")
$ListView1_1 = GUICtrlCreateListViewItem("456 |789", $ListView1)
GUICtrlSetOnEvent(-1, "Event")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Event()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case Else
$Val = GUICtrlRead(@GUI_CtrlId, 1)
$Val = StringSplit($Val, "|", 1)
MsgBox("", $Val, "相加结果:"&$Val+$Val)
EndSwitch
EndFunc ;==>Event
从listview中获取字符串,然后使用StringSplit后无法正常运算,求解!
king8462 发表于 2011-8-15 22:31 http://www.autoitx.com/images/common/back.gif
调用的是本地sql server 2000数据库! 无其他代码的,谁愿意帮你!
叫人家帮你猜? 晕,重新测试又可以计算了!
谢谢几位,打扰了!
页:
[1]