• 1 reply
  • Latest Post - ‏2019-07-16T17:53:10Z by PekkaMakinen
Christopher Cote
Christopher Cote
67 Posts

Pinned topic Checking for attribute existence

‏2019-07-16T16:46:36Z |

I am debugging someone else's code in which they are checking the value of an attribute that doesn't always exist in a module.  What is the proper way to determine if an attribute exists before getting its value?  I've tried using:


if (currObj."Attribute Name" != null)

but I get an "unknown Object attribute" error.



  • PekkaMakinen
    208 Posts

    Re: Checking for attribute existence


    In the current module

    if (exists(attribute "Attribute Name"))

    In any module m

    AttrDef ad = find(m, "Attribute Name")

    if (!null ad)