Skip to content

has property

by admin on May 6th, 2016
    if the target has property starfleetRank then
        put starfleetRank of the target into theRank
    else
        put "Citizen" into theRank
    end if

The has property operator can be used to determine if an object has a given property. This is especially useful if you are defining your own user properties on an object, but also comes in handy if you are creating a project that needs to run with older versions of Stacksmith but should also take advantage of a property only available in a newer version.

    if I have the property starfleetRank then play boing c e g
    if I have property serialNumber then play boing a5

The I have the property syntax is equivalent to using the has property operator on the object me, like:

    if me has property serialNumber then play boing a5
No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS