propertyChange Events script posibilities

Hi everyone…

I have doubt about propertyChange Events.

can i use the below code?..

if event.propertyName == "MODULE_REDU_STAT" or event.propertyName == "CHASIS_ID":

Yes, that is valid syntax. When checking multiple possibilities, I usually use the ‘in’ operator with a tuple to make it more readable. Like so:if event.propertyName in ("MODULE_REDU_STAT","CHASIS_ID"): ....whatever....Just be aware that you can’t use event.newValue and event.oldValue unconditionally in such code.

Thank you pturmel for the reply…

as you said not to use event.oldValue or event.newValue, can you tell me how i can use properties “MODULE_REDU_STAT”,“CHASIS_ID” in the code suppose i want to check the value on it. (both are integer tag)

[quote=“roshanbhosale”]as you said not to use event.oldValue or event.newValue, can you tell me how i can use properties “MODULE_REDU_STAT”,“CHASIS_ID” in the code suppose i want to check the value on it.[/quote].... event.source.MODULE_REDU_STAT .... .... event.source.CHASIS_ID ....[quote=“roshanbhosale”](both are integer tag)[/quote]Uhhm. I hope you meant integer property, that is, a custom property on the component where you are using the event script. This only applies to property names in the specific component (the scripting name of the property, if looking at a built-in property).

YES pturmel… i meant integer property…thank you for your help… :slight_smile: