Nope… does nothing.
No errors popping up? Are you using tabs for the indentation?
tabs for the indentation?
The indentation requires tabs instead of spaces.
oh … yes I am
Is it possible the syntax is different for the newer version?
I was wondering the same thing between Jython 2.5 and 2.7.
Try this in the Script Console
l = [1,2,3,1]
print l.count(1)
I thought list.count() was part of 2.5, but I could be wrong. My wife would say it wouldn’t be the first time. lol.
gave me a 2
do you do this for a living or something, cause I am no where close to this level of understanding… and my wife tells me the same thing.
Which it should have done since there’s two '1’s in the list… Okay then.
I’m an end-user, like many of us here. Sometimes, I’ll have time to tinker and learn.
I don’t have a VM with 7.9.x on it at the moment, but I’ll get one spun up and see if we can make this go.
I’m an end user also, but I come to this stuff via the automation side. I can program the snot out of PLCs and just about anything Allen Bradley, but the scripting side of this is extremely new to me.
Well, the big thing to remember is that, as with all programming, it does what we tell it to do, not what we want it to do.
Now that sounds like my wife and I…LOL
I wonder if this issue is also what is causing the script from the clear button not to work. Because of the columns…
I tried using the script you had on the clear button to clear out the table once the information has been transferred to my database and it gave me an error saying:
Traceback (most recent call last):
File “event:actionPerformed”, line 35, in
IndexError: Row 0 doesn’t have the same number of columns as header list.
Ignition v7.9.13 (b2019120915)
Java: Oracle Corporation 1.8.0_261
if colName=='Name':
from com.inductiveautomation.ignition.common import BasicDataset
config = {'background': 'white'}
data = BasicDataset(self.data)
compareList = list(data.getColumnAsList(colIndex))
if compareList.count(value)>1 and value<>None:
config = {'background':'yellow'}
return config
That works! So is it different between 7.9 and 8.0?
I think it's related here:
One last question on this thread: on the clear button you have on the example you provided me, I copied that code to also clear my table once I have submitted my information but I am getting this message:
Traceback (most recent call last):
File “event:actionPerformed”, line 35, in
IndexError: Row 0 doesn’t have the same number of columns as header list.
Ignition v7.9.13 (b2019120915)
Java: Oracle Corporation 1.8.0_261
Try sticking the same import at the top:
from com.inductiveautomation.ignition.common import BasicDataset