COUNT FOR 路数比='3:0:0' to lsb1
COUNT FOR 路数比='2:1:0' to lsb2
COUNT FOR 路数比='2:0:1' to lsb3
COUNT FOR 路数比='1:2:0' to lsb4
COUNT FOR 路数比='1:1:1' to lsb5
COUNT FOR 路数比='1:0:2' to lsb6
COUNT FOR 路数比='0:3:0' to lsb7
COUNT FOR 路数比='0:2:1' to lsb8
COUNT FOR 路数比='0:1:2' to lsb9
COUNT FOR 路数比='0:0:3' to lsb10
FOR i=1 TO 10
tt=ALLTRIM(STR(i))
thisform.pageframe1.page1.container4.label&tt..Caption=trans(eval('lsb'+ trans(i)))
thisform.pageframe1.page1.container4.label&tt..refresh
IF thisform.pageframe1.page1.container4.label&tt..Caption='0'
thisform.pageframe1.page1.container4.label&tt..visible=.f.
else
thisform.pageframe1.page1.container4.label&tt..visible=.T.
ENDIF
ENDFOR
我查询按钮里面有很多地方要用到这些代码,如果都去写一遍,太长了(这里我只列举了一部分,其实还有很多
),也不利于程序的可读性,有没有好的办法
主要是下面这些方法:
FOR i=1 TO 10
tt=ALLTRIM(STR(i))
thisform.pageframe1.page1.container4.label&tt..Caption=trans(eval('lsb'+ trans(i)))
thisform.pageframe1.page1.container4.label&tt..refresh
IF thisform.pageframe1.page1.container4.label&tt..Caption='0'
thisform.pageframe1.page1.container4.label&tt..visible=.f.
else
thisform.pageframe1.page1.container4.label&tt..visible=.T.
ENDIF
ENDFOR