Script Tester and name 'isNull' is not defined

Hi!

I have a problem to use isNull() function within Script Tester.
I am getting error:

Traceback (most recent call last):
File “”, line 8, in
NameError: name ‘isNull’ is not defined

What I am thinking is that I have to import some module but I do not have idea which module.
Is there any manual regarding scripting and modules which has to be import to be able to use certain function?

Thank you

Hi, falko,

Null in python is None. There are two ways to check for something being None:

If value is None: doSomething else: doSomethingElse

If value == None: doSomething else: doSomethingElse

Or, to check if it’s not None:

If value is not None: doSomething else: doSomethingElse

If value != None: doSomething else: doSomethingElse

3 Likes

Thanks Jordan,

That is working.
But still iI have problem with some Expression Functions (Appendix B. Expression Functions from Ignition help). I try to use some of them in Interactive Script Tester, but I am getting similar error, for example:
NameError: name ‘toradians’ is not defined
or
NameError: name ‘toInteger’ is not defined

Question is where I can use them if they are not working in Script Tester?

Ah. Expression language and Scripting are two separate animals.

Expressions are used in Tags and Transaction groups. Scripts are python code.

Thanks Jordan,

That was something what I had to know.
Thanks a lot.