I'm trying to determine the datatype of a custom property on a tag between an array or a dataset. Some sample script is below. I can't seem to figure out how to determine the ignition datatypes... (ta and tb are tags with a custom property called "States". ta is an array datatype, tb is dataset)
Is there something I should be importing into the scripting?
Jython doesn’t competely describe all java types, particularly arrays and lists, since it runs all types through its own system before apply pure java to the outliers. (The type() function is jython, not java.) In java, you normally use an object’s .getClass() method to inspect what it really is, and that normally works when jython’s type() function is insufficient. Unfortunately, jython’s access wrapper suppresses this method on java arrays, presumably as part of support for iterating over them like normal python sequence types.
It so happens I was playing with this problem yesterday, and worked out how to get the java class of arrays. For your edification (paste in the script console’s multiline buffer and execute):
Poke around in the public javadoc for java and Ignition for more information.
{ Also, please edit your post so it is more readable. Highly all the code you posted and click the “preformatted text” button at the top of the editor. This one: </>. }