发布于 2005-04-15 23:12:42
0楼
请问变量是顺序变化的吗?例如:pic1_1变-pic1_2变-pic1_3变-pic1_4变。
是的话你只要顺序判断就可以了
如果是随机变化的话你就需要在TIMER中不停的判断了;将四个变量整合成一个CHR型变量;
判断如下:
timer1_timer()
dim PLC as string
dim PLC1 as string
PLC=str$(pic1_1)+str$(pic1_2)+str$(pic2_1)+str$(pic2_2)
select case PLC
case "0000"
不处理
case "0001"
pic2.show
case "0010"
pic2.show
case "0011"
pic2.show
case "0100"
pic1.show
case "0101"
if PLC1="0100" then pic2.show
if PLC1="0001" then pic1.show
case "0110"
if PLC1="0100" then pic2.show
if PLC1="0010" then pic1.show
case "0111"
pic2.show
case "1000"
pic1.show
case "1001"
if PLC1="1000" then pic2.show
if PLC1="0001" then pic1.show
case "1010"
if PLC1="1000" then pic2.show
if PLC1="0010" then pic1.show
case "1011"
pic2.show
case "1100"
pic1.show
case "1101"
pic1.show
case "1110"
pic1.show
case "1111"
if PLC1="1111" then 不处理
if PLC1<>"1111" then
if mid$(PLC1,1,2)="11" then pic2.show
if mid$(PLC1,3,2)="11" then pic1.show
end if
end select
PLC1=PLC
end sub
如果pic1_1为1时pic2_1变为1了,pic2应该出现吧(我是这样想的)
匆匆写的,可能漏了,还可以简化,下面兄弟姐妹的帮忙吧
还有,我不是老师,我是学生,呵呵
爱我中华!