注册 登录
编程论坛 VFP论坛

求教:列表多选数字相加不正确

chn8690 发布于 2021-01-12 19:55, 1269 次点击
列表多选数字相加不正确,寻求帮助
只有本站会员才能查看附件,请 登录
2 回复
#2
吹水佬2021-01-12 21:09
程序代码:
thisform.label1.caption = ""
thisform.label2.caption = ""
FOR i=1 TO thisform.list2 .listcount
    IF thisform.list2 .selected(i)
        thisform.label1.caption = thisform.label1.caption + thisform.list2.List(i,1)
        thisform.label2.caption = TRANSFORM(VAL(thisform.label2.caption) + VAL(thisform.list2.List(i,2)))
    ENDIF

 ENDFOR
#3
chn86902021-01-12 21:33
回复 2楼 吹水佬
非常感谢哟
1