為什么這個腳本不能翻轉(zhuǎn)變量
112.95.251.214
發(fā)布于2014-04-24 10:27
215
0
標簽:
一個鼠標動作
subonclick(byvalitem)
ifhmiruntime.tags("變量1").value=vbtruethen
hmiruntime.tags("變量1").writevbfalse
else
hmiruntime.tags("變量1").writevbtrue
endif
endsub
上面那個腳本只能置位變量,不能復(fù)位變量是為什么?
佳答案
建議:
dimmytag
setmytag=hmiruntime.tags("testbit")
mytag.read
ifmytag.value=0then
hmiruntime.tags("testbit")write1
else
hmiruntime.tags("testbit")write0
endif
或者c腳本:
settagbit("testbit",!gettagbit("testbit"));
*******
關(guān)于vbtrue和vbfalse的說明,可以在wincc的幫助里可以搜索到。
vbtrue-1
vbfalse0