Add a little test to see OnChange's .count .first .last in action
authorEdouard Tisserant
Thu, 10 Dec 2020 15:48:15 +0100
changeset 2699 467ff0e58327
parent 2698 e50d32c747b3
child 2700 144b149cded4
Add a little test to see OnChange's .count .first .last in action
tests/python/py_ext_0@py_ext/pyfile.xml
--- a/tests/python/py_ext_0@py_ext/pyfile.xml	Thu Dec 10 14:54:42 2020 +0100
+++ b/tests/python/py_ext_0@py_ext/pyfile.xml	Thu Dec 10 15:48:15 2020 +0100
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='utf-8'?>
 <PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <variables>
-    <variable name="SomeVarName" type="DINT" onchange="MyFunc"/>
+    <variable name="SomeVarName" type="DINT" onchange="MyFunc, SomeChange"/>
     <variable name="Grumpf" type="STRING" initial="'mhoo'" onchange="MyFunc, MyOtherFunc"/>
   </variables>
   <globals>
@@ -15,6 +15,11 @@
 def MyOtherFunc(*args):
     print "other", args
 
+def SomeChange(*args):
+    print "count",OnChange.SomeVarName.count
+    print "first",OnChange.SomeVarName.first
+    print "last",OnChange.SomeVarName.last
+
 
 ]]></xhtml:p>
   </globals>