$instanceparent

Return the name of the parent instance of the specified component instance.

$instanceparent { (InstanceName) }

Parameters

Parameters
Parameter Data Type Description
InstanceName String Name of component instance; optional. If omitted, the current instance is used.

Return Values

  • Name of the parent instance of InstanceName when:
    • InstanceName is a modal form instance that is not started from the apStart trigger.
    • InstanceName is an attached, non-modal component instance. (A detached, non-modal component instance has no parent.)
  • Empty string (""), in the following circumstances:
    • InstanceName is a child of the application screen. For example, InstName is a detached, non-modal form instance or is a modal form instance started from the apStart trigger.
    • InstanceName is running on a server and its parent is running on the client. In this case, InstanceName is considered to be a child of the application screen that belongs to the Application Server application.
    • An error occurred. $procerror contains a negative value that identifies the exact error.
Values of $procerror Commonly Returned Following this Function
Value  Error constant Meaning
-57 <UACTERR_NO_INSTANCE> The named instance cannot be found in the component pool.
-1101 <UPROCERR_FIELD> An incorrect field name was provided; either the field name is not valid syntactically or the field is not available in the component.
-1105 <UPROCERR_INSTANCE> The instance name provided is not valid. For example, the argument contains incorrect characters. For more information, see newinstance.
-1304 <UPROCERR_UNKNOWN_CONTEXT> Function not allowed, unknown context. The InstanceName argument was omitted and one of the following occurred:

There is no current instance, for example, in the apStart trigger.

The current instance is a form started with run.

Use

Allowed in all component types.

Reporting the Parent of the Current Instance

The following example reports the current instance's parent in the message frame:

putmess "%%$instanceparent is the parent of %%$instancename"

Related Topics