Built-in functions: EwIsPrimaryObject()

The function EwIsPrimaryObject() verifies whether an object is the primary object within the actual prototyping session.

Declaration

bool EwIsPrimaryObject( object aObject )

Parameters

aObject

Object to test.

Discussion

The function EwIsPrimaryObject() verifies whether the object passed in the parameter aObject does represent the component you are currently editing in Composer or testing in Prototyper window. This function is available in the prototyping environment of Embedded Wizard only. Therefore you should enclose it always between a pair of $if .. $endif compiler directives to avoid Chora errors when generating code for the target system:

This function is useful if you need to perform operations during editing or prototyping of a component only. For example:

$if $composer // Is 'this' object the instance of the actually edited component? if ( EwIsPrimaryObject( this )) trace "Yes"; $endif $if $prototyper // Is 'this' object the instance of the component started in Prototyper? if ( EwIsPrimaryObject( this )) trace "Yes"; $endif

See also EwIsSecondaryObject().